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.

FindDuplicatesResult Class

Output for rule-based searches for duplicate records. FindDuplicatesResult contains results of detecting duplicates using instances of FindDuplicates or FindDuplicatesByIds classes.

Namespace

Datacloud

FindDuplicatesResult Properties

The following are properties for FindDuplicatesResult.

duplicateresults

A list of DuplicateResult objects representing the results of calling FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids). Elements in the list correspond to sObjects or IDs in the input list.

Signature

public List<Datacloud.DuplicateResult> duplicateresults

Property Value

Type: List<DuplicateResult>

errors

A list of Database.Error objects holding errors resulting from calling FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids).

Signature

public List<Database.Error> errors {get; set;}

Property Value

Type: List<Database.Error>

success

Boolean signifying whether the call to FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids) was successful.

Signature

public Boolean success {get; set;}

Property Value

Type: Boolean

FindDuplicatesResult Methods

The following are methods for FindDuplicatesResult.

getDuplicateResults()

Returns a list of DuplicateResult objects representing the results of calling FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids). Elements in the list correspond to sObjects or IDs in the input list.

Example

1Account acct = new Account(name='Salesforce');
2List<Account> acctList = new List<Account>();
3acctList.add(acct);
4
5Datacloud.FindDuplicatesResult[] results = Datacloud.FindDuplicates.findDuplicates(acctList);
6for (Datacloud.FindDuplicatesResult findDupeResult : results) {
7  for (Datacloud.DuplicateResult dupeResult : findDupeResult.getDuplicateResults()) {
8    for (Datacloud.MatchResult matchResult : dupeResult.getMatchResults()) {
9      for (Datacloud.MatchRecord matchRecord : matchResult.getMatchRecords()) {
10          System.debug('Duplicate Record: ' + matchRecord.getRecord());
11      }
12    }
13  }
14}

Signature

public List<Datacloud.DuplicateResult> getDuplicateResults()

Return Value

Type: List<DuplicateResult>

getErrors()

Returns a list of DatabaseError objects containing errors resulting from calling FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids), if errors were encountered.

Signature

public List<Database.Error> getErrors()

Return Value

Type: List<Database.Error>

isSuccess()

Returns a Boolean signifying whether the call to FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids) was successful.

Signature

public Boolean isSuccess()

Return Value

Type: Boolean