Skip to content
Snippets Groups Projects
onActionProcess.js 761 B
import("Employee_lib");
import("system.vars");
import("system.neon");
import("DuplicateScanner_lib");

let sourceContactId = vars.get("$param.DuplicateCurrentContactId_param");
let targetContactId = vars.get("$sys.selection");

//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);

if(mergeSuccess)
{
    let currentContactId = EmployeeUtils.getCurrentContactId();
    DuplicateScannerUtils.CreateMergeSuccessActivity(sourceContactId, targetContactId, currentContactId, "Organisation");
    neon.openContext("Organisation", "OrganisationMain_view", [targetContactId], neon.OPERATINGSTATE_VIEW, null)
}