New Year’s Resolution 1: DeDuping Records
How many times have you found duplicate records in Salesforce? I find them all the time, especially duplicate Leads. Well, my first resolution this year is to identify all the duplicate Leads in the MK Partners instance of Salesforce. Here’s how I’m going to do it:
- Determine what fields have to be the same in order for two records to be considered duplicates. For this example, any records with the same email address are duplicates.
- Create a new field as follows:
Datatype: Email
Field Label: Unique Email
Unique: Check this box! - Using the Apex Data Loader, Extract a list of all Leads that have Emails, be sure to include the Lead Id and Email fields.
- Using the Apex Data Loader, run an update on Leads using the success file generated in step 3. Map Id to “Id” and Email to “Unique Email”.
The resulting errors file will be a list of duplicate Leads and the Id’s of their duplicates.
This information is extremely useful as you no longer have to go randomly searching for duplicates, you have the complete list in a single file.
If you’re new to Salesforce, you can paste the Id’s one by one into your browser (eg www.salesforce.com/000000000000000000 ) to see more about the records and use the built in Merge functions.
If you’re somewhat savvy, then you can update these records, mark them as duplicates, and notify their creators/owners that they need to fix the problem.
If you’re like me, then you’ve probably already created an s-control that can merge up to 200 pairs of duplicate records at a time.
Either way, you’re starting the new year with a cleaner set of data!
Happy New Year from MK Partners.