Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

MatchRecord

Represents a duplicate record detected by a matching rule.

Fields

Field Details
additionalInformation
Type
AdditionalInformationMap
Description
Other information about matched records.
fieldDiffs
Type
FieldDiff[]
Description
Matching rule fields and how each field value compares for the duplicate and its matching record.
matchConfidence
Type
double
Description
The ranking of how similar a matched record’s data is to the data in your request. Must be equal to or greater than the value of the minMatchConfidence specified in your request. Returns -1 if unused.
record
Type
sObject
Description
The fields and field values for the duplicate record.

Usage

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

Each MatchRecord represents a duplicate detected when a record is saved. There can be multiple MatchRecord objects for a saved record if multiple duplicates are detected.

Java Sample

Here is a sample that shows how to display the ID and type of all duplicates detected when a lead is 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 (MatchRecord mr : m.getMatchRecords()) {
2    System.out.println("Your record matched " + mr.getRecord().getId() + " of type "
3        + mr.getRecord().getType());
4    System.out.println("The match confidence is " + mr.getMatchConfidence());
5}