FindDuplicatesByIds Class

Performs rule-based searches for duplicate records. The input is an array of IDs. Each ID specifies records to search for duplicates among. The duplicates are detected based on the active duplicate rules applicable to the object type corresponding to the input IDs.

Datacloud

The following are methods for FindDuplicatesByIds.

  • findDuplicatesByIds(ids)

    Identifies duplicates of record IDs provided and returns a list of FindDuplicatesResult objects.

Identifies duplicates of record IDs provided and returns a list of FindDuplicatesResult objects.

FindDuplicatesByIds uses the duplicate rules for the object that has the same type as the input record IDs. For example, if the record ID represents an Account, FindDuplicatesByIds uses the duplicate rules associated with the Account object.

FindDuplicatesByIds identifies duplicate records according to activated standard and custom matching rules. Standard matching rules don’t include custom fields in their matching criteria. You can configure custom matching rules that do include custom fields for matching criteria, and then assign the custom matching rule to a duplicate rule. However, configuring these rules isn’t a part of the Datacloud API.

  • Input:

    • All record IDs in the input array must be of the same object type, and that type must correspond to an object type that supports duplicate rules.
    • The input array is limited to 50 elements. If you exceed this limit, an exception is thrown with the following message: Configuration error: The number of records to check is greater than the permitted batch size.
  • Output:

    • The output of FindDuplicatesByIds is an array of objects with the same number of elements as the input array, and in the same order. The output objects encapsulate record IDs for duplicate records. The output objects also contain values from the duplicate records.
    • Each element contains an array of DuplicateResult objects, which each represent a duplicate rule that FindDuplicatesByIds applied. Within each DuplicateResult object is an array of MatchResult objects, which each represent a matching rule that the duplicate rule applied. If FindDuplicatesByIds doesn’t find any duplicates for that matching rule, then the MatchResult.getMatchRecords() array is empty. Otherwise, the MatchResult.getMatchRecords() array contains MatchRecord objects, which each represent a duplicate record.
    • If no duplicate rule is active for the object type of the record IDs in the input array, a System.HandledException exception is thrown with this message: No active duplicate rules are defined for the {ObjectName} object type.

public static List<Datacloud.FindDuplicatesResult> findDuplicatesByIds(List<Id> ids)

  • ids:

    Type: ListID> A list of IDs for which you want to find duplicates.

Type: List<FindDuplicatesResult>