Custom matching rules in Salesforce allow organizations to define specific criteria for identifying duplicate records. By configuring custom matching rules, we can improve data accuracy, prevent duplicates, and record management. In this blog, let us discuss the considerations on optimizing Custom Matching Rules in Salesforce.
Limits
- You can activate or deactivate up to five matching rules at a time.
- A maximum of five active matching rules is allowed per object.
- A total of 25 active matching rules can be used across all objects.
- You can have up to 100 total matching rules, including both active and inactive ones.
- Each matching rule can include only one lookup relationship field.
Evaluation Order of Fuzzy Matching Method Segments
- If a matching rule contains a filter with an OR operator and multiple fuzzy matching fields, only the segment closest to the end is evaluated.
- Consider a filter includes the following criteria:
- (1) Account Name (fuzzy)
- (2) Address (exact)
- (3) Phone (exact)
- (4) Zip Code (exact)
With the logic (1 AND 2) OR (1 AND 3) OR (1 AND 4), only (1 AND 4) is evaluated, while (1 AND 2) and (1 AND 3) are ignored.
If the logic is (1 AND 2) OR (1 AND 3) OR (1 AND 4) OR (2 AND 4), then (1 AND 4) OR (2 AND 4) is evaluated, while (1 AND 2) and (1 AND 3) are ignored. To prevent skipped logic, create separate matching rules for each OR segment containing the same fuzzy fields.
International Data Considerations
- Fuzzy matching methods support only Latin characters.
- For international data, it’s recommended to use exact matching instead.
Lookup Fields
- If a lookup field value is a person account and the matching rule includes a contact lookup field, the rule won’t be applied.
- All contact lookup fields, except Reports To on the Contact object, contain both contacts and person accounts.
- To exclude person accounts, configure a lookup filter.
- If you need to match person account values, use an account lookup field instead.
Records in Hierarchies
- If the primary record in a duplicate merge is lower in a hierarchy than another selected duplicate, the merge cannot proceed.
- Solution: Choose a different primary record or update the Parent Account or Reports To field before merging.
Unavailable Fields
- If a field is removed from your org, any matching rule using that field will be ignored.
- Always check duplicate rule field mappings when modifying fields in your org.
Shield Platform Encryption Considerations
- Standard matching rules do not detect duplicates if fields use Shield Platform Encryption.
- Custom matching rules can reference encrypted fields only if they are encrypted deterministically.
- Probabilistic encryption is not supported.
- After rotating key material, affected matching rules must be deactivated and reactivated, followed by a request to Salesforce for a background encryption process.
- Matching rules can search for up to 100 match candidates, but this limit can be extended up to 200 candidates with Shield Platform Encryption. This will reduce or eliminate duplicate matches.
To learn more about shield platform encryption, click How Shield Platform Encryption Works




