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

Automatically Merge Duplicate Records



Is it possible to write an APEX trigger or S-Control that would merge duplicate records based on certain duplicate rule.


For example, is it possible to automatically merge records upon insert or update if a lead's full name and website match that of a contact's full name and contact's account website?



Vijay RautVijay Raut



Merge is work on objects with same object type. Mean we can merge two leads or two contact,... but not one lead with one contact.


You can use apex trigger to avoid save on those leads (which are falls into contact - using name and website).







Were you ever able to figure out a way to do this? I am looking for a similar solution.





We created validation rules on lead fields we consider to be unique to reduce the number of duplicate leads from being created.


We also purchased a third party de-duping software to help reduce duplicates that are created.  There are many out there but the one that we went with is DemandTools

I have a duplicate rule which detects the duplicates. We have several duplicates. Is there a way to automatically merge duplicates after detection?