TECHLOGBOOKS

Tuesday, 1 May 2018

Finding and Deleting Duplicate Records in Salesforce




Let’s suppose you have duplicate records in an entity, say Opportunities with some custom field Opportunity Number being same for multiple records. These are redundant records which may not be useful and you want to get rid of it. 

In order to delete these records, you may think of making this field as unique but, this is not allowed without removing duplicates in this field. 

One of the ideal option is to go to developer console (Setup > Developer Console) and run below query. 

1
select id,name,Oppty_Number__C from opportunity order by Oppty_Number__C 



With this you can not only see the opportunity records but also edit and delete the unwanted ones. 

Also, not in the above query you can user "Group By" clause, but if you use this you cannot edit the resulting records. 

No comments:

Post a Comment