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 LearningSFDC Learning 

Delete duplicate data

I want to delete duplicate tasks from my org ,because of workflow rule duplicate tasks are assigned to users so how to remove duplicate data

Thanks in advance
Run a Batch Apex to find out duplicates and Delete the list in finish().
Gyanender SinghGyanender Singh
Hi Sumaiya Vhora,

There are two ways to delete duplicate task, as per your requirement your workflow rule create duplicate task so my question is that your workflow rule is active now and it wil work regularly so for this you can use :

1) Batch class and in this batch class create a list of task in which you can fetch all duplicate task and delete those list and shedule this class at every day 12 am or as per your time.

2) If you want to delete duplicate task only once then you can use anonymous code in developer console and in this code same fetch the all duplicate task in the list of task and delete those list and exceute the code from the developer console.

You might checkout DupeTools from IOLITE on the appExchange - it has an audit function that will do auto-merge.