I have a duplicate rule on Account
that is triggered matching of a field. Once the duplicate rule runs, it identifies two accounts with the same field value as duplicate and a duplicate warning on the account is highlighted. As per Salesforce's documentation, during all this duplicates calculation few other records are created that is DuplicateRecordSet
and DuplicateRecordItem
.
DuplicateRecordSet –
Represents a group of records that have been identified as duplicates. Each duplicate record set contains one or more duplicate record items. Use this object to create custom report types and view the results of duplicate jobs.
Problem with duplicate report
A duplicate report is based on the above objects, DuplicateRecordSet and DuplicateRecordItem to identify, reconcile, and merge duplicate.
If, I update one of the accounts and change the field value on the account, duplicate rule fires and finds a negative match. Hence, the duplicate alert from both the account is removed but the report still shows those two accounts are duplicate because the records in both DuplicateRecordSet object and DuplicateRecordItem, are not deleted once there is a negative match on existing duplicate records.
Now, that report is very important for the client but with these false negative account on the report, is just very odd.
Best Answer
Got an answer from Salesforce that this is working as designed and appears to be limitation. According to this article
Salesforce proposed solution
To manually delete the Duplicate Record Sets
Lightning Experience
Salesforce Classic
Note: Deleting Duplicate Record Sets only deletes the Duplicate Record Items and not the actual records. It is also possible mass delete Duplicate Record Sets using the Mass Delete option or Dataloader.