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
- Provide the Rule name and set the matching criteria. Then click on Save button.
- Once done then dont forget to click on Active button
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
- 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
- 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
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.
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.
Duplicate Rule Consideration and Best Practices
Foll below duplicate rule consideration and best practices.
- You can use to to 5 active duplicate rules per object
- If the first rule finds a match for a record subsequent duplicate rules skip that record
- Condition Under which duplicate Rules Don’t run
- Records are created using quick create or community self registration.
- Leads are converted to account or contacts.
- Records are restored with the un-delete button
- Record are added using Lightning sync
- Record are manually merged.
- Condition under which duplicate rule settings are overridden
- Records are added using the data import tools
- Record are added or edited using Salesforce APIs
- 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.