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
Marco Schmit 30Marco Schmit 30 

Duplicate Record Item not removed after Account is not longer a duplicate

Hi all,

I'm trying to find out how the Duplicate Record Set/Item objects work.
My scenario:
  1. Create an Account
  2. Create another Account in way that the Duplicate Record warning message pops up
  3. Click Save and Ignore
  4. 2 Duplicate Record Items got created (so far so good)
  5. Change one of the duplicate Accounts, so they are not duplicates anymore
  6. My understanding that the Duplicate Record Items should be deleted now - but they are not
Is my expected behavior incorrect?

Thanks for helping!
Neetu_BansalNeetu_Bansal
Hello Marco,

Unfortunately Duplicate Record Set/Item will not trigger will deleting record and that's reason it is not updating the Duplicate Record Items. It will only work in case of insert and update.

Thanks,
Neetu
Marco Schmit 30Marco Schmit 30
Hi Neetu,
thanks for your response. I'm not sure if I got your answer correctly. 
"It will only works in case of insert and update" ... of what? The duplicate account or duplicate record item/set?
It also seems to work if the duplicate accounts is deleted. The associated Duplicate Record Set and Items get deleted then as well.

In the end, I want to create a checkbox which is true if the record is an duplicate and false otherwise. Maybe there is another way to accomplish this?
Neetu_BansalNeetu_Bansal
Hello Marco,

You can achieve this by writing trigger. If you are not familiar with apex coding, I can assist you.

Thanks,
Neetu
Marco Schmit 30Marco Schmit 30
Well, I wanted to avoid rewriting a logic to find duplicats by createing a trigger on the DuplicateRecordItem object to set the checkbox on insert, delete etc. but if those records are not deleted then this approach will not work obviously. 
So I will go the the Trigger approach for each object.

Thanks!
 
Marco Schmit 30Marco Schmit 30
Winter 18 released the following:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Datacloud_FindDuplicates.htm

So no need to rewrite any logic to find duplicates
Cheryl Fernandes BNCheryl Fernandes BN
This free app contains a process builder that invokes a flow to delete the Duplicate Record Set record as soon as you merge the Leads, Contacts or Accounts that created the duplicate. https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000EcxYXUAZ