Support Ukraine 🇺🇦 Help Provide Humanitarian Aid to Ukraine.
For Everyone

Duplicate Records in Salesforce

8 min read
CloudAnswers photo

Blog post updated on the 25th of March 2022

Maintaining a clean and consistent database is important to keep a business running smoothly. But it requires a never-ending process of removing duplicates, cleaning bad data, enhancing records, backing up data, and more. In today’s post, we’d talk about one of the first things to start with - Salesforce duplicate management.

Duplicate records are almost unavoidable, especially when you have data coming from multiple sources or multiple users. They are stress agents. Imagine calling a prospect only for them to reply that your company reached out earlier. Or telling a customer that you didn’t get their order just to realize that you were looking at the wrong record for them. Or sending someone several emails because you have multiple leads for them. There are many ways that duplicates can hurt your reputation and directly impact your business.

Therefore, it is vital to know how to find duplicate accounts in Salesforce, remove them, and prevent them. And when it comes to duplicate checks in salesforce, there are several options. For example, a search for duplicates on the AppExchange provides over 260 results! So that you can find duplicate accounts in Salesforce in a single search.

So where should you start? Read on to know your options and how you can prevent and merge duplicates in Salesforce. If you’d rather have someone else put together a recommendation specifically for your company you can schedule some time to talk.

Salesforce Duplicate Rules

Most Salesforce systems come with Duplicate Management, a way to alert users about duplicates. Salesforce Duplicate report Management requires setting up Duplicate Rules and Matching Rules (although some are set up by default).

  1. Duplicate Rules answer the question: what happens if a duplicate is identified? These define what happens when someone views a duplicate or tries to edit or create a duplicate.
  2. Matching Rules answer the question: what is a duplicate? These define what fields and criteria are used to match records. Matching Rules are used in Duplicate Rules.

The standard account duplicate rule is one of the defaults that come with Salesforce. The Matching Rule is referenced in the Duplicate Rule.

Customizing Matching Rules

Matching rules are the best place to start since they determine what defines a duplicate. Before sitting down to create these rules, make sure to review your data and talk to your team. Some things to think about or discuss with your team:

  • What fields are populated when records are created? You don’t want to create a matching rule that uses the Website field, for example, if you never fill in that field.
  • What fields help identify which records aren’t duplicates? There are a lot of scenarios where you might want to allow records that are similar, so identifying unique fields like Email or Address can help avoid matching records that aren’t actually duplicated. You can also use a field for a related object, like Account on Contact, to limit the potential duplicates to only those on the same related object.

How broadly do you want the potential duplicates to be? When setting up rules you can cast a wide net or a small one. If your users are well-trained and familiar with merging records you can make your matching rules broader and let the users decide if a record is a duplicate or not. Otherwise, you can set up stricter rules and users will get fewer warnings about potential duplicates.

To set up your Matching Rules, follow these steps:

  1. In Salesforce Setup, search for Matching Rules on the left menu
  2. Click New Rule to create a new rule or click Edit to edit an existing rule. Note: Rules that are active cannot be edited, deactivate the Duplicate rule and the Matching Rule to edit. Standard rules cannot be edited.
  3. Choose the object that the matching rule is for.
  4. Enter a rule name and select the fields and matching method for each one. For details on the matching methods, check out the Salesforce help.
  5. If you have advanced logic (like match on Name and Address OR Email), then click Add Filter Logic to enter the logic.
  6. Save and activate your rule. Depending on the amount of data and Salesforce’s current server load, the activation could take a while to generate keys for all of the records.

That’s it, you now have a matching rule that you can use in your duplicate rules.

Customizing Duplicate Rules

Now that you have matching rules, you can decide what happens when they find a match. To customize Duplicate Rules search for Duplicate Rules in Salesforce Setup. Like Matching Rules, there are a few things you may want to consider before setting these up:

  • Should duplicate checks bypass sharing? If your organization's records are private, you'll have to determine whether or not to share them. If you disable sharing, the user records that others don't have access to aren't displayed, but it may prevent them from duplicating them even if they can't view the original.
  • Do you want to prevent the creation of duplicates? Warn users, or report it to admins Your company must decide how stringent it wants to be when it comes to duplication, and this should be considered alongside your matching standards. If you have stringent matching restrictions, it's easy to decide whether to prevent people from making duplicates, but if you don't, you might only want to notify them. If you don't want to annoy your users, simply report the duplicate and let them make or change it.

To set up a Duplicate Rule, follow these steps:

  1. In Salesforce Setup, search for Duplicate Rules on the left menu.
  2. Click New Rule and choose an object or edit an existing rule. To edit a rule, you have to deactivate it first.
  3. Name the rule - if you plan to have a lot of rules, consider a naming convention so it’s easier to find the rule you need to edit.
  4. Bypass sharing rules if needed - if you want to match on all records, change Record-Level Security to Bypass sharing rules.
  5. Choose what happens on Create and Edit. If you want to prevent duplicates, choose Block. Otherwise, choose if you want to Alert the user or Report the duplicate. Enter your Alert message if needed.
  6. Choose your matching rules. Note that you can use multiple matching rules and can even compare records with a different object (for example Contacts with Person Accounts).
  7. Specify your conditions, if applicable. This is a good place to filter out any automated processes, for example, you could avoid blocking the web-to-lead records by setting a condition for Lead Source not equal to “Website”.
  8. Save and Activate.

That’s it, now go test your new rule and see if it works correctly.

Viewing Duplicates

Now that you have your duplicate rules set up, you might want to view the duplicates.

Viewing Duplicates on Reports

To report on the duplicates, you’ll need to create a new report type and then create a report.

  1. Go to Report Types in Setup
  2. Create a new Report Type
  3. Choose the object that has duplicates as the primary object (i.e. Leads, Contacts, Your Custom Object)
  4. Relate Duplicate Record Sets to the primary object.
  5. Save the report type and create a report.

Viewing Duplicates on Records

One of the best ways to keep up with duplicates is to display them prominently on the records so that users can see them and merge them if they are allowed. In Lightning Experience, Accounts, Contacts, and Leads come with a pre-built component for this. If you’re trying to use a custom object, or just want a little more control over the component, install our free Potential Duplicates Component.

If you don’t see potential duplicates on a page, here’s what to do:

  1. If you haven’t already, install our potential duplicates component from the AppExchange.
  2. Open up a record that you want to see duplicates on.
  3. Click the gear icon in the top right and click Edit Page to launch the Lightning App Builder.
  4. Drag the Potential Duplicates component onto the page wherever you’d like.
  5. If desired, specify the columns that you want to display on the component or on the merge screen.

The Potential Duplicates Component

Merging Duplicates

If you happen to be on Performance or Enterprise edition, you can use Salesforce’s Duplicate Jobs to leverage your Duplicate Rules and merge records. If not, you’ll have to decide if you want to develop a tool to merge duplicates, use something from the AppExchange, or let users merge the records.

If you installed the Potential Duplicates Component in the last section or have the standard duplicates component on Leads, Accounts, or Contacts then you can start merging records immediately. Just open any record that has a duplicate and click the Review and Merge button to open the merge screen. You can start from a report on potential duplicates from the last section then click into one of the records to merge from the potential duplicates component. Otherwise, users can view and merge duplicates as they are working in the system.


Maintaining a CRM system with accurate data is critical for any business to succeed. Removing duplicates is one of the easier ways to improve data quality and a huge benefit to the users and the businesses’ financials. For those just getting started with duplicate management, start with setting up Duplicate Rules and Matching Rules to prevent or identify duplicates, then figure out a plan to merge them and keep it clean moving forward.

CloudAnswers photo

About CloudAnswers

Salesforce apps, powerful components, custom development, and consulting. Our experienced team helps you to create and modify workflow processes in salesforce.

Related Articles

For Everyone

Product Launch: CloudAnswers Shop Builder

Are you looking for an easy way to launch an ecommerce shop? Our new app, Shop Builder, is now in public beta! We’re looking for companies that want to build an online shop but don’t want to spend thousands building it out.

April 12, 2024

5 Min Read

For Everyone

A Day in the Life of a Project Manager at CloudAnswers

I'm Emily, and I've been a project manager at CloudAnswers for the last two years. It can be a nebulous role, but I like to say I act as a bridge between the product vision and tangible results, whether that is building a custom app for a client or one of our own Salesforce products. My typical day revolves around managing tasks, ensuring progress, and maintaining standards while adhering to project timelines.

March 22, 2024

5 Min Read

For Everyone

Create a Custom Lightning Component for Alert and Confirm Dialogs

As front-end developers, there can be numerous instances when we need to display a prompt, a confirm dialog, or a confirm dialog with some input control to accept some value from the user. If you happen to be a Salesforce developer reading this article, you must have had such a requirement while writing lightning components.

March 4, 2024

6 Min Read