Preventing Salesforce duplicates will save you heaps of time in the future. Just like any other CRM database, no matter how hard you try to keep them out, Salesforce duplicates (salesforce duplicate records) are going to happen.
A user may fail to search first before creating a new record in Salesforce.
A user may search Salesforce first but does not see the duplicate record due to Salesforce sharing settings.
Or a user (or admin) may upload files into Salesforce from a service with a tool that does not check for duplicate records. Either way, it is an ongoing process to keep the database clean.
Salesforce duplicates can cause all sorts of issues: from wasted effort to upset customers and user apathy.
- Multiple reps could be working the same account without knowing it.
- Reporting can be skewed from the extra records.
- Customers could be contacted by different reps on the same subject, be it a sale or case.
- All of this results in users eventually quitting using Salesforce since they have to wade through a bunch of records to find the proper one.
There are some steps you can take to keep Salesforce duplicates to a minimum including:
- Instructing users on how to search before creating a record.
- Limiting imports to only a few key people.
- Using a third party app from the AppExchange like RingLead or Dupe Blocker.
Salesforce Enterprise users have an additional option using workflow and unique fields to create your own Salesforce duplicate record blocking tools.
What follows are the steps to stop Salesforce duplicate contacts from being created or uploaded regardless of your sharing settings. This does require a required field. For the contact records, I recommend making the standard “Email” field required on the page layout.
Create a new text field on the Contact object and call it something like “Duplicate Test”. Set the attributes so that it is unique and not case sensitive like the picture below. You do not need to add the field to any page layouts.
Then create a workflow rule that fires “every time a record is created or edited” with the following formula criteria:
OR(
ISBLANK( Contact_Duplicate_Test__c ) ,
ISCHANGED( Email ) ,
ISCHANGED( LastName )
)
You can change the “Contact_Duplicate_Test__c” to the name of the text field you created. You want the rule to look like the picture below with your field name in the place of mine.
After saving the workflow rule, add a field update to update your unique text field with the following formula that concatenates the Last Name, a dash, and the email address: (picture below)
LastName & “-” & Email
Activate the workflow and give it a test. In the picture below, you can see my test field on the bottom left.
When I try to create a new contact with the same last name and email address, I get the error in the picture below and I am unable to save the record:
Since the “unique” attribute works at a system level, this will work even if the user does not have permission to view the existing record. They could click the name link in the error but they would only get an error page that they do not have permission to view the record.
It also works when uploading records with the Data Loader or another tool. The Data Loader will return the failed uploads in the error file, allowing you to cross reference them to see if they need updating or not.
You can create the same setup on the Lead object as well using the same fields. Or you can use any other fields that are unique when combined. For accounts, you may want to use the Account Name combined with the Billing or Shipping Address Street and State. For opportunities, the Opportunity Name combined with the Account Name and the Amount may work for you. The possibilities are endless. You just want to make sure you are combining fields that result in a unique test string that would only be duplicated if the record was duplicated.