Duplicate Rules and Matching Rules in Salesforce

In this post we will talk about Duplicate Rules and Matching Rules in Salesforce. Matching rules and Duplicate rules work together to ensure your org data is duplicate free. Duplicate management in Salesforce helped you to detect duplicates record base on custom duplicates and marching rules.

What is Duplicate Rules?

A duplicate rule helped you to define what happens when a we views a record with duplicates or starts creating a duplicate record. Salesforce provides standard out of the box duplicate rules for accounts, contacts, and leads. Base on business requirement you can also create custom duplicate rules in Salesforce.

With Duplicate rules we can define when Salesforce found matching record and determines actions to take as it encounters duplicates.

What is Matching Rules?

A matching rule helped you to defines how duplicate records are identified in duplicate rules and duplicate jobs. Salesforce provides out of the box standard matching rules for accounts, contacts, and leads. Base on business requirement you can also create custom matching rules in Salesforce. With matching rules we can define the criteria to identify duplicate records.

Salesforce Duplicate Rules Example

Take one example. Business want to make sure agent will not create duplicate record base on account me and Street address.

Matching rules and Duplicate rules work together to ensure your org data is duplicate free. So we need to build matching rules first then we will create the duplicate rules.

Create a Custom Matching Rule

Follow below step by step process to create the matching rules in Salesforce.

  • Click on Setup then search the matching rules in quick find.
  • Then click on matching rules then click on New Rule button.
  • After that select the object on which you want to apply the matching rule. In our case Account object
Matching Rule in Salesforce
  • Provide the Rule name and set the matching criteria. Then click on Save button.
  • Once done then dont forget to click on Active button
Matching Rule criteria

Create a Custom Duplicate Rules

Once your matching rules are ready then it time to create duplicate rules. Follow below step to create the duplicate rules.

  • Click on Setup then search the duplicate rules in quick find.
  • Then click on duplicate rules then click on New Rule button then select the Account object like below screen
Duplicate Rules in Salesforce
  • Now it time to setup the duplicate rule. provide the all required details.
  • Specify what happens when a user tries to save a duplicate record as Allow and provide the error message.
  • Select newly created matching rules in matching rules section like below screen
Create Duplicate Rules in Salesforce
  • Add the Optionally, conditions a record must meet for the rule to run.
  • then click on save and activate button.

Test Duplicate Rules

Now it time to test the duplicate rules. Create one account with same name and street which already available in you Salesforce org. Then It will give you error message with one View Duplicate option. Like below screen

Then click on View Duplicate link to see duplicate records like below screen

View Duplicate Records.

NOTE: I will still allow you to save the record because you selected the allow duplicate in duplicate rules. If you do not want to allow then select block option

Merge Duplicate Record

It time to merge duplicate account records. If you want to merge the duplicate record then click on related list and find the View Duplicate option

Then select the other duplicate record which you want to merge and click on next button. From that you can select Master record and you can also merge the field values base on record.

Merge Duplicate record on Account object

Then click on next and confirm button. Congratulation now you know how to setup duplicate rules in Salesforce and how to merge two duplicate records.

Recording

Check recording to step by step process to create the duplicate rules in Salesforce.

YouTube video

Duplicate Rule Consideration and Best Practices

Foll below duplicate rule consideration and best practices.

  1. You can use to to 5 active duplicate rules per object
  2. If the first rule finds a match for a record subsequent duplicate rules skip that record
  3. Condition Under which duplicate Rules Don’t run
    1. Records are created using quick create or community self registration.
    2. Leads are converted to account or contacts.
    3. Records are restored with the un-delete button
    4. Record are added using Lightning sync
    5. Record are manually merged.
  4. Condition under which duplicate rule settings are overridden
    1. Records are added using the data import tools
    2. Record are added or edited using Salesforce APIs
  5. Translation workbench doesn’t support the customizable alert text in duplicate rules.

Summary

Matching rules and Duplicate rules work together to ensure your org data is duplicate free.

Amit Chaudhary
Amit Chaudhary

Amit Chaudhary is Salesforce Application & System Architect and working on Salesforce Platform since 2010. He is Salesforce MVP since 2017 and have 17 Salesforce Certificates.

He is a active blogger and founder of Apex Hours.

Articles: 460

Leave a Reply

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