function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Admin DNAAdmin DNA 

findDuplicates "The list of results isn't the same size as the input list"

Hi,
I receive this error " The list of results isn't the same size as the input list" when I run this class:
public static void findDuplicates() {
        Lead ld = new Lead(LastName='aaa', MobilePhone='11', Phone='11', Email='aaa@aaa.it', LeadSource='Passaparola');
        Lead ld1 = new Lead(LastName='aaa', MobilePhone='111', Phone='111', Email='aaa@aaa.it', LeadSource='Passaparola');
        List<Lead> leadList = new List<Lead>();
        leadList.add(ld);
        leadList.add(ld1);
        
        Datacloud.FindDuplicatesResult[] results = Datacloud.FindDuplicates.findDuplicates(leadList);
        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());
              }
            }
          }
        }
Any Ideas?
thanks in advance