Skip to main content


Eliminating Data Duplication: A Guide to Duplicate Rules in Salesforce

Istock 1473508658

Hello Trailblazers!

In the area of Salesforce data management, maintaining data accuracy and integrity is paramount. Duplicate records not only clutter databases but also lead to inefficiencies in sales, marketing, and customer service processes. To address this challenge, Salesforce offers Duplicate Rules, a powerful feature designed to identify and prevent the creation of duplicate records.

To create the duplicate rule, we’ll require the matching rule. So, if you would like to know what is Matching Rule and how to create it, then you can go with this link.

In this blog, we’ll explore the significance of Duplicate Rules, their implementation, and best practices for maximizing their effectiveness.

So let’s get started!

What is a Duplicate Rule?

Duplicate Rules in Salesforce are a set of criteria that define when a new record is considered a duplicate of an existing record. These rules help organizations enforce data quality standards by identifying potential duplicates in real time during data entry or import processes. By preventing the creation of duplicate records, Duplicate Rules ensure a clean and reliable database.


How to Create Duplicate Rules?

Here we’ll create a duplicate rule on the Employee object to ensure that duplicate employee records should not created.

To create the duplicate rule, follow the below steps:

  1. Go to the Setup.
  2. Enter Duplicate Rules in the Quick Find box.
  3. Click Duplicate Rules under Duplicate Management.
  4. It’ll take you to the Duplicate Rules page where Standard Duplicate rules for Account, Contact, and Lead Objects are already created as shown in the figure below.Img1
  5. Click on the “New Rule” as shown above.
  6. Select the “Employee” object.
  7. Define the Rule name.
  8. In the Record Level Security, select the “Enforce Sharing Rules”.
    The difference between the Enforce Sharing and Bypass Sharing rules is, that when you enforce sharing rules, the matching rule only considers records that the user has access to, whereas when bypassing sharing rules, all records are evaluated without any access restrictions.
  9. In the actions, Set the actions that should be taken when a user creates or edits a duplicate record. When you choose alert, provide a suitable alert message explaining why the user is unable to save the information and what the next step is.
    See the figure below.
  10. In the Matching rules section, the object will be there – already selected.
  11. Then, click on the dropdown and select the desired matching rule. Here I’m selecting the matching rule that we created in the previous blog. If you do not know how to create a matching rule, then you can go with this link.Img3
  12. By clicking on “Add Rule” button, you can also add multiple matching rules.
  13. If the rule requires any conditions to be met, then you can define those criteria. This is optional.
  14. Click Save.
  15. Click Activate.Img4

With this simple steps, you can create a duplicate rule for any object.

Now it’s time to test the Duplicate rule and Matching rule that we’ve created so far.


Testing the Duplicate Rule:

  1. To test the rule, create a record that matches the field of the existing record. Here, we create a new employee record whose “Email” field matches the existing employee record.Img5
  2. So, it will give an “Alert Message” that this record is a potential duplicate.
  3. Click “View Duplicate” to see the duplicate records as shown above.
  4. You can see it has one duplicate record.

But, if you ignore this, you can still save the record even if it is a duplicate.

How to Prevent Users from Saving Duplicate Records?

To prevent users from saving duplicate records, you need to block the permission/action. So, to achieve this, follow the instructions below.

  1. Open the Duplicate rule that you created.
  2. Click Edit.
  3. Under the Actions, select “Block” when Create and Edit Action. This will restrict the user from saving the record if the duplicate is found.Img7
  4. Click Save.

Your rule will look like this.


Duplicate Rules in Salesforce are a vital tool for maintaining data quality and preventing the proliferation of duplicate records. In this way, you can create a duplicate rule and specify the actions like Allow or Block to allow and block the user from saving the duplicate records.

Happy Reading!!



  1. Duplicate Rules Salesforce
  2. How to Customize Duplicate Rules?

You Can Also Read:

  1. An Introduction to Salesforce CPQ
  2. Salesforce CPQ and its Key Features
  3. Unlocking the Power of AI: Einstein for Developers
  4. Revolutionizing Customer Engagement: The Salesforce Einstein Chatbot

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Abhinav Masane

Abhinav Masane is an Associate Technical Consultant at Perficient based in Nagpur. He is a Salesforce Certified Associate and Developer. Abhinav is always keen to learn and explore new technologies.

More from this Author

Follow Us