Setting Up Duplicate Rule And Matching Rule In Salesforce

Article Written By:
Varalatchumi V
Created On:

January 11, 2025

Setting up Salesforce duplicate rules and matching rules

In Salesforce, matching rules define how records are compared to find potential duplicates, and duplicate rules decide what happens when a match is found, whether to block, alert, or allow the entry. You set them up in Setup by activating or building a matching rule for an object, then creating a duplicate rule that references it and choosing its action. Together they are Salesforce duplicate rules in practice, the platform's built-in duplicate management, and this guide walks through setting up both.

Duplicate records are one of the most common and costly data-quality problems in any CRM. They waste time, split a customer's history across records, and quietly undermine reports. The good news is that Salesforce gives you the tools to catch and prevent duplicates without extra software. This guide covers what matching rules and duplicate rules do, how to set each up, how to test them, and how to keep your data clean over time.

Here is the quick view before the detail.

Question Short Answer
What is a matching rule? It defines how Salesforce compares records to spot duplicates
What is a duplicate rule? It decides what happens when a match is found
Where do you set them up? In Setup, under Matching Rules and Duplicate Rules
Which objects? Standard rules exist for accounts, contacts, and leads

‍

What Are Matching Rules And Duplicate Rules?

Matching rules and duplicate rules in Salesforce work as a pair to power its native duplicate detection. One finds possible duplicates; the other decides what to do about them. Understanding the split is the key to setting them up well.

Matching rules set the standard by which Salesforce compares records. A matching rule can check whether two contacts share the same email address, or whether two accounts have a similar name and the same city. Matching criteria can be exact or fuzzy, so "Bob" and "Robert" can still match when you want them to.

Duplicate rules act on what the matching rule finds. When a match is detected, the duplicate rule decides whether to block the save, warn the user with an alert, quietly report it, or allow it. In short, matching rules find similar records, and duplicate rules manage what happens next.

Aspect Matching Rule Duplicate Rule
Job Finds potential duplicates Decides what happens when one is found
Defines The matching criteria and method The action: block, alert, report, or allow
Runs Behind the scenes during comparison On create or edit of a record
Types Standard matching rules or custom matching rules One per object, referencing a matching rule

‍

Setting Up Matching Rules In Salesforce

Salesforce ships with standard matching rules for accounts, contacts, and leads that are ready to activate. Because every business handles data differently, you can also build custom matching rules for your own fields and logic. Here is the matching rule setup.

  • Go to Setup. Open Setup in your Salesforce org.
  • Search for Matching Rules. Type "Matching Rules" in the Quick Find box and open it.
  • Create a new rule. Click New Rule and choose the object, such as leads, accounts, or contacts.
  • Define the matching criteria. Match by email, phone, name, or any field combination that identifies a duplicate for you.
  • Set the matching method. Choose exact or fuzzy matching for each field.
  • Save and activate. Activate the rule so it is ready for a duplicate rule to use.

A matching rule does nothing on its own; it only supplies the logic a duplicate rule calls on. So activate it, then move to the duplicate rule that will put it to work.

Setting up duplicate rule and matching rule in Salesforce for duplicate management

Setting Up Duplicate Rules In Salesforce

With a matching rule active, create the duplicate rule that acts on it. This is the duplicate rule setup that turns detection into prevention.

  • Go to Setup. Open the Setup menu.
  • Search for Duplicate Rules. Type "Duplicate Rules" in the Quick Find box.
  • Create a new rule. Click New Rule and select the object, such as leads, contacts, or accounts.
  • Pair it with a matching rule. Choose the matching rule you activated earlier.
  • Define the rule behavior. Set the action on create and edit, and name the profiles allowed to override it.
  • Activate the rule. Turn it on to start preventing duplicate records.

The action you choose is the heart of your duplicate prevention, and the duplicate rule criteria you set decide how strict the record matching becomes. The table below explains each option and when to use it.

Action What It Does When To Use It
Block Stops the duplicate from being saved Strict duplicate prevention on key objects
Alert Warns the user but lets them save When people need judgment on edge cases
Report Allows the save and logs it for review Auditing duplicates without blocking work
Allow with override Lets chosen profiles bypass the rule Giving senior users a controlled exception

‍

Duplicate Rules By Object

Most duplicate management rules are set per object, because a duplicate means something different on each one. Salesforce provides standard rules for the three objects where duplicates cause the most trouble, and you can tailor each.

  • Lead duplicate rules. Catch the same prospect entering twice from different forms or campaigns, usually matching on email or company plus name.
  • Contact duplicate rules. Stop the same person appearing under one account more than once, often matching on email or name and account.
  • Account duplicate rules. Prevent the same company being created twice, matching on account name and location such as city or billing address.

Handled together, these three cover the bulk of everyday duplicate record management. Set the standard rules live first, watch how they behave, then adjust the criteria per object as your data teaches you what a real duplicate looks like.

‍

Testing And Validating Your Rules

Never trust a new rule until you have seen it work. Test with sample data before you rely on it, so you know your duplicate check behaves as intended.

  • Create sample records. Make a new account with the same name and address as an existing one.
  • Check for the alert. If the rule works, you will see a warning and a "View Duplicates" option.
  • Review the matches. Open View Duplicates to see every record the rule flagged.
  • Confirm the save behavior. A block rule stops the save; an alert rule lets you continue.

Watch for two errors as you test. A false positive flags a record that is not really a duplicate, and a false negative misses a real one. If either shows up, tune your matching criteria: tighten it to catch more real duplicates, or loosen it to stop over-flagging. Schedule regular checks as your database grows, and train your team to read the alerts correctly.

‍

Managing And Merging Duplicate Records

Rules stop new duplicates, but you also need a plan for the ones already in your org. That is where data deduplication, record deduplication, and merging come in.

To merge duplicate records in Salesforce, you can use the native merge feature on accounts, contacts, and leads to combine two or three records into one, keeping the field values you choose. For large-scale cleanup, third-party AppExchange tools such as DemandTools, Cloudingo, or Duplicate Check handle bulk deduplication and deeper analysis than the native tools alone. These are worth considering when a one-time cleanup is too big to do by hand, or when you import data often and want to prevent duplicate records at the point of entry.

Whatever route you take, test any bulk tool or import in a sandbox first, so your live data stays safe while you confirm the results. Community walkthroughs on SFDCStop and Salesforce Geek are useful when you compare cleanup approaches.

‍

Duplicate Management Best Practices

A few Salesforce duplicate management best practices keep your records clean long after setup.

  • Start with the standard rules, then customize only where your data needs it.
  • Use block for the objects where a duplicate does real harm, and alert where judgment matters.
  • Review your matching criteria as your data changes, so the rules keep pace.
  • Pair rules with a periodic data cleansing routine to catch what slips through.
  • Make duplicate management part of your wider data governance, not a one-off fix.

Strong data hygiene is a habit, not a project. Pairing these rules with a regular Salesforce health check keeps your CRM data quality high as the org grows. The Salesforce Admins hub and Salesforce Ben both publish helpful guidance on keeping records clean.

‍

Frequently Asked Questions

1. What is the difference between a matching rule and a duplicate rule in Salesforce?

A matching rule defines how Salesforce compares records to find potential duplicates, using criteria like email or name. A duplicate rule decides what happens when a match is found, whether to block, alert, report, or allow the record. They always work together.

2. How do I set up duplicate rules in Salesforce?

Go to Setup, activate or create a matching rule for the object, then create a duplicate rule that references it. Choose the action, such as block or alert, name any profiles that can override it, and activate the rule. Test with sample records before you rely on it.

3. Does Salesforce have standard duplicate and matching rules?

Yes. Salesforce provides standard matching rules and duplicate rules for accounts, contacts, and leads that you can activate right away. You can also build custom matching rules when your data needs criteria the standard rules do not cover.

4. How do I merge duplicate records in Salesforce?

Use the native merge feature on accounts, contacts, or leads to combine records and keep the field values you choose. For large volumes, third-party tools handle bulk deduplication. Always test a bulk merge in a sandbox first.

5. How do I prevent duplicate records in Salesforce?

Activate duplicate rules set to block or alert on your key objects, keep your matching criteria current, and add a data-quality routine for imports. Together these prevent most duplicate records from ever entering the system.

‍

Build A Duplicate-Free Salesforce Database

Clean data starts with the right rules. Set up matching rules to define what a duplicate looks like, add duplicate rules to decide what happens when one appears, test both with sample records, and merge the duplicates you already have. Keep the criteria current, and your Salesforce CRM data quality stays high as the org grows.

If you would like help designing rules that fit your data, or a one-time cleanup to start fresh, Minuscule Technologies offers Salesforce implementation and data-quality services built around your org. As a certified Salesforce consulting partner and Salesforce implementation partner, we help you build a duplicate-free database that stays that way. Contact us today to get started.

Contact Us for Free Consultation
Thank you! We will get back in touch with you within 48 hours.
Oops! Something went wrong while submitting the form.

Recent Blogs

Ready to Architect Your Salesforce Success?

You've seen what's possible. Now, let's make it happen for your business. Whether you need an end-to-end Salesforce solution, a complex integration, or ongoing managed services, our team is ready to deliver.

Schedule a Free Strategic Call