Input & Output
Merge records (List of IDs)
The doMerge
method merges multiple Salesforce records into a single master record, following the rules defined in the Plauti Deduplicate Merge Rules. It returns a boolean to indicate success or failure.
Method Signature
Method Name: doMerge
Boolean doMerge(List<Id> objectList)
Parameters
Type | Variable | Description |
---|---|---|
List<Id> | objectList | A list of Salesforce record IDs representing the input. |
Output
true:
The merge was successful.false:
The merge failed.
Apex Example
This snippet specifies a list of duplicate Contact record IDs, initializes the Duplicate Check API, and merges the records using the doMerge
method. It logs the IDs, executes the merge, and outputs whether the operation was successful or failed.
// List of IDs for the records you want to merge
List<Id> duplicateContactIds = new List<Id>{
'003J8000007jigQIAQ', '003J8000007jigRIAQ'
};
System.debug('Duplicate Contact IDs specified: ' + duplicateContactIds);
// Initialize the Duplicate Check API
dupcheck.dc3Api dc3Api = new dupcheck.dc3Api();
System.debug('Duplicate Check API initialized.');
// Execute the merge using the Duplicate Check API
System.debug('Executing merge operation for the specified Contact IDs...');
Boolean isMerged = dc3Api.doMerge(duplicateContactIds);
System.debug('Merge operation completed. Merge result: ' + isMerged);
// Output result with conditional feedback
if (isMerged) {
System.debug('Merge was successful.');
// Add any post-merge actions here if required
} else {
System.debug('Merge failed.');
}
Updated 17 days ago