Newer Version Available

This content describes an older version of this product. View Latest

MatchResult

Represents the duplicate results for a matching rule.

Fields

Field Details
errors
Type
Error[]
Description
Errors that occurred during matching for the matching rule.
entityType
Type
string
Description
The entity type of the matching rule.
matchEngine
Type
string
Description
The match engine for the matching rule.
matchRecords
Type
MatchRecord[]
Description
Information about the duplicates detected by the matching rule.
rule
Type
string
Description
The developer name of the matching rule that detected duplicates.
size
Type
int
Description
The number of duplicates detected by the matching rule.
success
Type
boolean
Description
true if the matching rule successfully ran. false if there’s an error with the matching rule.

Usage

MatchResult and its constituent objects are available to organizations that use duplicate rules.

There is 1 MatchResult for each saved record that has duplicates. The MatchResult contains all duplicates for that saved record.

Java Sample

Here is a sample that shows how to display the ID and type of all duplicates detected when leads are saved. See DuplicateResult for a full code sample that shows how to block users from entering duplicate leads and display an alert and a list of duplicates.

1for (MatchResult m : dupeResult.getMatchResults()) {
2    if (m.isSuccess()) {
3        System.out.println("The match rule that was triggered was " + m.getRule());
4        for (MatchRecord mr : m.getMatchRecords()) {
5            System.out.println("Your record matched " + mr.getRecord().getId() + " of type "
6                + mr.getRecord().getType());
7            System.out.println("The match confidence is " + mr.getMatchConfidence());
8        }
9    }
10}