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.
MatchResult
A MatchResult object has these fields.
| Field | Details |
|---|---|
| errors |
|
| entityType |
|
| matchEngine |
|
| matchRecords |
|
| rule |
|
| size |
|
| success |
|
Usage
MatchResult and its constituent objects are available to organizations that use duplicate rules.
There’s one MatchResult for each saved record that has duplicates. The MatchResult contains all duplicates for that saved record.
Java Sample
Here’s 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}