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.
  • errors
    A list of Database.Error objects holding errors resulting from calling FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids).
  • success
    Boolean signifying whether the call to FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids) was successful.

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.
  • getErrors()
    Returns a list of DatabaseError objects containing errors resulting from calling FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids), if errors were encountered.
  • isSuccess()
    Returns a Boolean signifying whether the call to FindDuplicates.findDuplicates(sObjects) or FindDuplicatesByIds.findDuplicatesByIds(ids) was successful.

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

Account acct = new Account(name='Salesforce');
List<Account< acctList = new List<Account<();
acctList.add(acct);

Datacloud.FindDuplicatesResult[] results = Datacloud.FindDuplicates.findDuplicates(acctList);
for (Datacloud.FindDuplicatesResult findDupeResult : results) {
  for (Datacloud.DuplicateResult dupeResult : findDupeResult.getDuplicateResults()) {
    for (Datacloud.MatchResult matchResult : dupeResult.getMatchResults()) {
      for (Datacloud.MatchRecord matchRecord : matchResult.getMatchRecords()) {
          System.debug('Duplicate Record: ' + matchRecord.getRecord());
      }
    }
  }
}

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