You cannot run the merge process via SuiteTalk.
There are a couple of ways to achieve your goal. To my mind the simplest thing would be to create a custom field on customer that indicates "merge to master" and then run a schedule script to check for customers with values in that field and run a merge to master process.
So basically:
- create a custom field that holds a reference to a the master record
- update that field on the to-be-merged duplicate via SuiteTalk
- create a scheduled script that checks for that field being populated; when found the script would set up a merge job
You don't have to have duplicate detection turned on in your Netsuite account for this to work. The merge engine is accessible via suitescript. The function below takes the internal id of the master and duplicate record and sets up the merge job:
function queueMerge(masterId, mergeId) {
try {
var manager = nlapiGetJobManager('DUPLICATERECORDS');
var dupeJob = manager.createJobRequest();
dupeJob.setEntityType(dupeJob.ENTITY_CUSTOMER);
dupeJob.setMasterSelectionMode(dupeJob.MASTERSELECTIONMODE_SELECT_BY_ID);
dupeJob.setMasterId(masterId);
dupeJob.setOperation(dupeJob.OPERATION_MERGE);
dupeJob.setRecords([masterId, mergeId]);
var jobId = manager.submit(dupeJob);
nlapiLogExecution("DEBUG", "setup merge for " + mergeId + " with " + jobId);
} catch (e) {
nlapiLogExecution("ERROR", "on merge for " + mergeId, e);
}
}