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

let targetContactId = vars.get("$param.DuplicateCurrentContactId_param");
let sourceContactId = 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();
    if(currentContactId == null)
        currentContactId = "";
    DuplicateScannerUtils.CreateMergeSuccessActivity(sourceContactId, targetContactId, currentContactId, "Organisation");
    neon.refreshAll();
}