diff --git a/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js b/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js index d75b5308bf2fc6e831e6bc45112b1ca8a5fcd0fe..29dab7b72c8898044cfabd79426552733f9f7dc4 100644 --- a/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js @@ -4,7 +4,7 @@ import("system.neon"); import("DuplicateScanner_lib"); let sourceContactId = vars.get("$param.DuplicateCurrentContactId_param"); -let targetContactId = vars.get("$sys.selection"); +let targetContactId = vars.get("$sys.selection")[0]; //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.mergeOrganisation(sourceContactId, targetContactId); diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index e85d22cd516edd861880b9120d762d093b2f46e3..d6feb5a5ebbaa78f43fbb37a3ecaf6cf2ca90692 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -673,8 +673,8 @@ DuplicateScannerUtils.mergeOrganisation = function(pSourceContactId, pTargetCont .where("CONTACT.CONTACTID", pSourceContactId) .cell(); - var isLinkedDataUpdated = _DuplicateScannerUtils._migrateLinkedContactData(pSourceContactId, pTargetContactId); - var isParticipantsUpdated = _DuplicateScannerUtils._migrateParticipantsToNewContact("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", + _DuplicateScannerUtils._migrateLinkedContactData(pSourceContactId, pTargetContactId); + _DuplicateScannerUtils._migrateParticipantsToNewContact("CAMPAIGNPARTICIPANT", "CONTACT_ID", "CAMPAIGN_ID", pSourceContactId, pTargetContactId); var deleteStatements = []; @@ -692,7 +692,7 @@ DuplicateScannerUtils.mergeOrganisation = function(pSourceContactId, pTargetCont DuplicateScannerUtils.deleteCachedDuplicate(pSourceContactId); - return ((isLinkedDataUpdated || isParticipantsUpdated) && deletedRows >= 2); + return deletedRows >= 2; } /*