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
Sfdc wonderSfdc wonder 

How to remove duplicate records

Hi,

i have one requirement regarding avoid duplicates of products in salesforce.i.e,any new Product with same info like Name,Productcode matches with existing product record,the old one can be deleted and new one will be inserted.

can any one suggest me how to achieve this....



manhnt.bkitmanhnt.bkit
Hi RamSf,
You can use exist apps on Appexchange : https://appexchange.salesforce.com/results?keywords=duplicate
Or you can write your own trigger to avoid this duplicate.
Trigger will look like this:
---
Trigger before insert on Product {
   1.query records with same info like Name, Product Code
   2. if the result of query greater than 0 --> duplicate
        

}