Shared Contacts and Merging in DemandTools
If I enable Shared Contacts, what will be the impact when merging Contacts and Accounts via DemandTools?
As long as "Use Salesforce Merge" is checked (which is the default and highly recommended), the merge will work exactly the same as when merging Accounts and Contacts "within an account" in the Salesforce User Interface as we use Salesforce's API merge code to execute the merge.
Salesforce WILL NOT allow a merge to complete if it will result in duplicate relationships.
The Acme account has 2 Jon Smith contact records BOTH with an indirect relationship to XYZ Company. When Salesforce tries to update the contact ID on the non -master's contact relationship record it will be rejected since there is already one with the same contact and account ID.
There are 2 Acme Accounts, and one of the Accounts has a Contact that has an indirect relationship to the OTHER Acme Account. When Salesforce tries to update the Account ID on the non-master's account relationship record it will be rejected since there is already one with the same account and contact ID.
If this is encountered when merging in DemandTools the merge will fail with the following information in the DemandTools logfile (this example is for a contact merge):
2016-06-07T15:13:05-06:00,Single Table Dedupe,"Merge To Master",Contact,Merge,003B0000006dyeoIAA,,,,""
2016-06-07T15:13:05-06:00,,"Merge Call Failure",,,,,,,"Msg:Before you can merge contacts, you must ensure that the merge won't result in duplicate account relationships by removing these existing relationships:
|Account Name||Contact Names|
|XYZ||Jon Smith, Jon Smith|
StatusCode:208 Fields: "
2016-06-07T15:13:05-06:00,Single Table Dedupe,"Dedupe complete",,,,,,,""
2016-06-07T15:13:05-06:00,Single Table Dedupe,"Batch Dedupe",Contact,,,,,,"0 Contact objects were merged into 0 Contact(s)
Note: The message is provided by Salesforce in raw html (we simply capture it in the log file). If you try to merge the exact same records directly in the Salesforce User Interface the message will be formatted in a readable fashion.
To successfully merge, the user will need to manually access one of the records and remove the relationship that would result in the duplicate, then reprocess the merge.
If there are no conflicts, the merges will complete. Contact/Account relationships on the non-master records are merged onto the master record (i.e. merging Contacts where the non-master Contact has an indirect relationship that DOES NOT currently exist on the master Contact).
***************Merging Contacts Between Accounts******************
Since Salesforce DOES NOT allow merging between Accounts in the user interface, the Salesforce API merge call does not take into consideration that the non-master Account could be different than the master account, and therefore does not check if an indirect relationship should be created as part of the merge process , i.e. when the Salesforce Shared Contacts option "Save the relationship between the contact and the previous primary account as an indirect relationship" is selected.
However, in DemandTools there is an option to "Reparent Contacts Before Contact Merge". Checking that option will create an indirect relationship on the master Contact since it re-parents the non-master Contact prior to executing the merge. The option can be found in DemandTools -> Options -> General Settings from the top menu.
Note: If the Salesforce Shared Contacts option "Delete the relationship between the contact and the previous primary account" is selected the DemandTools option noted above is irrelevant (no indirect relationship will be created).
Olivia M.J. Hinkle
Product Adoption Manager
We used related contacts in our SFDC org. They are preventing dupe merging. I am confused by your suggested work around. Will you explain further how we can merge accounts with related contacts without the merge failing and without having to manually remove the relationship each time?
Are you getting the error noted in the solution? If so, the only "workaround" is to manually remove the relationship each time. This is how Salesforce handles merging with shared contacts, you will get the same error if you tried to merge the same contacts using the Salesforce Contact merge option in the Salesforce User Interface.
It is tedious, but that is how Salesforce has the merge process working and we use their merge code.
Product Manager, DemandTools/DupeBlocker