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
Sravanthi GSravanthi G 

if there is duplicate records in object?how to delete that duplicates with same name?

if there is duplicate records in object?how to delete that duplicates with same name?
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Sravanthi,

May I suggest you please refer the below link to delete duplicate records. Hope it helps.

Please mark it as best answer if the information is that question is removed from an unanswered question and appear as a proper solution.

Rahul Kumar
Waqar Hussain SFWaqar Hussain SF
For deleting duplicate records assuming duplicate by name, You will have to first query all records then put names into a set to find duplicate reocrds and then delete the duplicate records.

Eg for deleting duplicate accounts
List<Account> Accounts = [Select ID, Name from Account];
set<string> DuplicateCheck = new set<string>();
set<Id> DupAccountIds = new set<Id>();
for(Account acc: Accounts){

delete [select Id from Account where Id IN :DupAccountIds];

Naveen DhanarajNaveen Dhanaraj
If you want to prevent from Entering Duplicate Records, you can use Standard Functionality Matching Rule and Duplicate Rule
These blogs will explain you step by step, (" target="_blank)

Matching Rule:
Duplicate Rule:

If you have already Duplicate Records then by using This App filter it,
Try This Apps,

Export The ID of the Duplicate Records and Delete it using Dataloader or workbench...

Insert, Update, or Delete Data Using Data Loader:
Saba asrarSaba asrar
I need help on below question QUESTION !!!!
User-added image
Waqar Hussain SFWaqar Hussain SF
What question do you have?