Duplicate records found in Salesforce
Problem
I am getting the following error in Magento when trying to synchronize a cusotmer
What does this mean?
This means that Salesforce already has a record which uses the same Magento ID you are trying to syncronize, however the customer information in Salesforce does not match what is in Magento. This issue is caused by the fact that you may currently have two or more separate Magento installations connected to the same Salesforce org OR you may have in the past connected a different Magento instalaltion to this org. There are several solutions how you can resolve this issue.
Solution #1 (Magento will address duplication automatically via PowerSync)
In Magento, navigate to Salesforce > Integration Setup > Customer Configuration page
Open Accounts and Contacts Integration section
Change "Automated merge" to Yes
Re-synchronize all records with the error above
As part of this process all duplicates Magento will identify will be merged automatically. IMPORTANT: Make sure to review Record Lookups section to make sure there are no surprises when duplicates will be merged by our system.
Solution #2 (if you have a small number of records with this issue)
In Salesforce, find the record by ID provided in the error message
Note the email address on the record (Let's call it email-A)
In Magento note the email address of the record which is failed synchronization (Let's call it email-B)
Try to find matching Contact in Salesfroce using email-B
If a match is found:
Remove Magento ID value from the record you found in STEP 1 and save that record in Salesforce
Manually add Magento ID for the record you found in STEP 4 and save that record
Re-try Syncronization from Magento
If a match was NOT found:
Remove Magento ID value from the record you found in STEP 1 and save that record in Salesforce
Re-try Syncronization from Magento
Solution #3 (if you have several Magento installations connected to the same Salesforce org)
You must use a Salesforce Sandbox or Developer version of Salesforce for each lower level Magento installation you have
Example:
Production Salesforce org is connected to your LIVE Magento installation
Sandbox A Salesforce org is connected to your STAGING Magento installation
Development Salesforce org is connected to your DEV Magento installation
and so on ...
After you complete the steps above
You must manually clean the data in Salesforce (this is probably your best bet and the safest route)
If you are just setting up your Salesforce org or very early in the process, you may also want to consider deleting all Lead, Contact, Account, Opportunity, Order and Magento Website records in Salesforce and re-syncronize everything from Magento