diff --git a/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js index c11899143d1d42791e44f77839bfe429be27a45a..ca0b25919563b1bba9983540465da1add48989e7 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js @@ -1,10 +1,12 @@ +import("system.logging"); import("system.vars"); import("system.neon"); import("DuplicateScanner_lib"); let targetContactId = vars.get("$field.CONTACTID"); let sourceContactId = vars.get("$sys.selection"); - +logging.log("targetContactId -> " + targetContactId); +logging.log("sourceContactId -> "+ sourceContactId); //todo the actual merge ought to happen in a separate view where the contact infos can be merged manually by the user. let mergeSuccess = DuplicateScannerUtils.MergePerson(sourceContactId, targetContactId); diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index bda26e666fa06914d203e8ff0a6110534ac1fd2f..a17329adff015e15fd0650c6a0bc931b2cb1b870 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -183,13 +183,13 @@ DuplicateScannerUtils.MergePerson = function(pSourceContactId, pTargetContactId) var sourcePersonId = db.cell("select PERSON_ID from CONTACT where CONTACTID = '" + pSourceContactId + "'"); var tableInfos = _DuplicateScannerUtils._getMergeUpdateTableInfos(); - updateStatements.push(_DuplicateScannerUtils._buildUpdateContactIdStatements(tableInfos, pSourceContactId, pTargetContactId)); - updateStatements.push(_DuplicateScannerUtils._buildUpdateAttachParticipantsToNewContactQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); + updateStatements.concat(_DuplicateScannerUtils._buildUpdateContactIdStatements(tableInfos, pSourceContactId, pTargetContactId)); + updateStatements.concat(_DuplicateScannerUtils._buildUpdateAttachParticipantsToNewContactQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); - deleteStatements.push(_DuplicateScannerUtils._buildDeleteRemoveObsoleteParticipantsRecordsQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); + deleteStatements.concat(_DuplicateScannerUtils._buildDeleteRemoveObsoleteParticipantsRecordsQuery("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId)); deleteStatements = deleteStatements.concat(_DuplicateScannerUtils._buildDeletePersonAndContactQuery(sourcePersonId, pSourceContactId)); - logging.log("updateStatements -> " + JSON.stringify(updateStatements)); + //logging.log("updateStatements -> " + JSON.stringify(updateStatements)); logging.log("deleteStatements -> " + JSON.stringify(deleteStatements)); //let affectedRows = db.updates(updateStatements); //let deletedRows = db.deletes(deleteStatements)