Skip to main content

SLAM_merge

Overview

Merges Salesforce records using the SOAP API merge operation. The victim records are deleted and their data is merged into the winner record. The merge operation uses the Salesforce merge() API and is subject to it's limitations. For example, a merge will fail if AccountContactRelationship Salesforce object is in use and the merge would result in two or more AccountContactRelationship records from the winner Contact to the same Account. The AccountContactRelationship data would have to be cleaned up first.

Parameters

NameTypeDefaultDescription
@sObjectNVARCHARRequiredSalesforce object type (typically 'Account', 'Contact', or 'Lead')
@winner_idNVARCHARRequiredSalesforce ID of the record to keep (master record)
@victim_id1NVARCHARRequiredSalesforce ID of the first record to merge into winner
@victim_id2NVARCHARNULLSalesforce ID of the second record to merge into winner
@portal_idNVARCHARNULLPortal ID for account merges involving portal users

Usage Examples

Merge two Account records:

EXEC dbo.SLAM_merge
@sObject = 'Account',
@winner_id = '0011234567890ABCAA',
@victim_id1 = '0011234567890DEFAA';

Merge three Account records:

EXEC dbo.SLAM_merge
@sObject = 'Account',
@winner_id = '0011234567890ABCAA',
@victim_id1 = '0011234567890DEFAA',
@victim_id2 = '0011234567890GHIAA';

Merge Contact records:

EXEC dbo.SLAM_merge
@sObject = 'Contact',
@winner_id = '0031234567890ABCAA',
@victim_id1 = '0031234567890DEFAA';