Simple Salesforce Duplicate Contact Blocker

Mask-Group-5@2x

Free Marketing Resources

Subscribe and get a free copy of our latest Content Marketing webinar plus we'll send you our 6-week email course Marketing with Clarity & Confidence.

One of the most obvious gaps in the ‘out-of-the-box’ salesforce.com toolkit is a duplicate blocker. There’s a free force.com labs duplicate blocker available on the app exchange , but it only finds duplicates with matching first name, last name & email address. That’s not always enough – especially since most of your contacts will have more than one possible email address.

My buddy Steve Caldwell and I came up with a simple work around that takes about 5 minutes to implement and doesn’t cost a dime. Rest assured, your org will still find a way to enter duplicate contacts, they always do, but this should help save some of your time and sanity.

1. Create A Unique ID Field

Create a text field (allow about 20 characters) and name it Unique ID. Make it read-only and don’t add it to any page layouts. Be sure you mark the field as a Unique ID field.

2. Create a Workflow

Now create a workflow that runs anytime a contact is created or edited. Assign a Field Update action to that workflow that combines the First Name and Last Name into one string in the Unique ID field. (John Smith unique id = johnsmith).

3. Update All Contacts

You’ll want to run the rule once to a. populate all the Unique ID fields and b. pull a list of existing duplicates. If you use the Apex Data Loader, this is really easy to do. Simply run a report that includes all of your contacts. You’ll only need to include the Contact ID column in this report. Then turn around and run an update through the Data Loader using that same list. Wa-lah! You’ve just updated all your contacts to have a Unique ID and your error report contains a list of existing duplicates you can go clean up.

4. Salesforce Administrator Triumphs

The next time a user tries to create a contact with the same first and last name as an existing contact, they’ll receive an error message that the Unique ID already exists and won’t be able to save.

This little trick should work for most objects you need to prevent dups on (leads, opportunities, custom objects, etc). If you run into multiple contacts with the same name, you may need to do something a bit more sophisticated or check the App Exchange for some paid solutions.

Heather Steele

After almost a decade of marketing in a corporate setting, she tired of being a corporate cog and decided to go it alone, bootstrapping a business based on one simple principle:   Partnership.   Follow her on Twitter @heathersteele03, LinkedIn, or our blog to learn how to turn your business into a beast.

Schedule a Call

Book a consultation — we’ll talk about your business goals and how we can help you reach them.

Get a Plan

We’ll create a digital marketing plan with flat-rate budget options

Grow

You start generating more leads and watch your business grow

Get on the road to awesome.

Go From Meh... to Mighty