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
Shivani Thakur 32Shivani Thakur 32 

The criteria to find the duplicate records should be configurable. Ex. If there are two leads in a system with same Email address, then keep the first lead entry & remove all the other leads.

AbhishekAbhishek (Salesforce Developers) 
You have to use duplicate detection.

https://fullcrm.com/salesforce-guide/how-to-remove-and-prevent-duplicate-records-in-your-salesforce-instance/

Try as mentioned above.


For further reference check this too,
https://blog.bessereau.eu/assets/pdfs/salesforce_data_quality_duplicate_prevention.pdf


If it helps mark it as the best answer.
 
Shivani Thakur 32Shivani Thakur 32
ok thanks i will try this.