Matching rules versus duplicate rules
Key Takeaway
A matching rule detects duplicates and a duplicate rule responds to them. A matching rule does nothing for users until a duplicate rule (or a duplicate job) uses it.
Salesforce uses two kinds of rules together to control duplicate records. A matching rule defines how to tell that two records are duplicates. A duplicate rule decides what happens when duplicates are found, such as warning the user with an alert, blocking the save, or logging it for a report.
How the two rules work together
| Matching rule | Duplicate rule | |
|---|---|---|
| What it is | The detection logic | The response policy |
| How it works | It is an equation that compares fields in a pair of records | When Salesforce finds duplicates, it engages its matching rules and decides what action to take |
When a user creates, clones, or edits a record, the two rules work in this order:
- The duplicate rule runs.
- Its matching rule produces a list of possible duplicates.
- The duplicate rule then either blocks the user (the Block option) or lets them save with an alert (the Allow option).
- The duplicate rule can also add the saved duplicate to a report for a manager to see.
Duplicate jobs also use matching rules, to find duplicates across the whole org.