diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index f92149a9377ecbc47ea11108097e9d441d3f71d2..38cf8c564a94030e4ccbbd061f49f2dbb7bed565 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -936,7 +936,7 @@ LeadImportUtils.scanLeadDups = function(pAllContactData) updDupVals = [dupStatus]; - toUpdate.push([dupUpdateLeadTable, ["DUPSTATUS"], null, updDupVals, newWhere([dupUpdateLeadTable, "LEADID"], leadID).build()]); + toUpdate.push([dupUpdateLeadTable, ["DUPSTATUS"], null, updDupVals, newWhere([dupUpdateLeadTable, "LEADSID"], leadID).build()]); } db.updates(toUpdate);//update Leads with the new status } diff --git a/process/Loghistory_lib/process.js b/process/Loghistory_lib/process.js index 03c42abab2aedf2bf54e2a89bc904e35ededeaab..99a4e42755aa52ed8bb2aa155ec88cff135efe8a 100644 --- a/process/Loghistory_lib/process.js +++ b/process/Loghistory_lib/process.js @@ -541,7 +541,7 @@ AuditUpdateSyncEntries.prototype.execute = function() switch (this.sqlAction + "-" + this.table) { case "U-CONTACT": - subSQL = this.idValue; + subSQL = [this.idValue]; break; case "U-PERSON": subSQL = newSelect("CONTACT.CONTACTID").from("CONTACT").where("CONTACT.PERSON_ID", this.idValue); @@ -555,7 +555,7 @@ AuditUpdateSyncEntries.prototype.execute = function() check = subSQL.arrayColumn().length > 0; break; case "D-ADDRESS": - subSQL = this.oldValues[this.columns.indexOf("CONTACT_ID")]; + subSQL = [this.oldValues[this.columns.indexOf("CONTACT_ID")]]; break; case "I-COMMUNICATION": case "U-COMMUNICATION": @@ -563,11 +563,14 @@ AuditUpdateSyncEntries.prototype.execute = function() check = subSQL.arrayColumn().length > 0; break; case "D-COMMUNICATION": - subSQL = this.oldValues[this.columns.indexOf("CONTACT_ID")]; + subSQL = [this.oldValues[this.columns.indexOf("CONTACT_ID")]]; + break; + default: + check = false; break; } - if(check) + if(check && !Utils.isNullOrEmpty(subSQL)) { newWhere("AB_SYNCCONTACT.CONTACT_ID", subSQL, SqlBuilder.IN()) .updateData(true, "AB_SYNCCONTACT", ["DATE_EDIT", "UPDATECONTACT"] , null, [vars.getString("$sys.date"), '1'], datetime.ONE_MINUTE * 5);