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

massive delete activity history


I want delete many activiy history for reduce the data storage into SF.


I did a query with data loader by query task using filter like "where createddate < 2010-06-01:00:00:00.000z" and work properly (I got id and I deleted with dataloader many task)


But I see that there are many activity history which I can't delete, I try to count it on eclipse with this code :

select count() from activityhistory where createddate < 2010-06-01....

 but eclips give me a popup : "you can't do a query into this object"


How can I get ids of activityhistory and then delete it with dataloader?






Raumil SetalwadRaumil Setalwad

Hello Friend,

I have checked it you cannot query on "Activity" object but another option is available to delete old activities using "Mass Delete Records" option available under "Data Management" section which is under "Administration Setup". On clicking it different deleting options are avaialble. Click on "Mass Delete Activities". On clicking that link  in New window you can add filter criteria for old activities and then click on find. Note at one time you can perform delete operation maximum on 250 Activities so select the activities which you want to delete and click on delete


Hope this helps



Thanks for reply.

I know this solution but is very slow than dataloader :(


thanks anyway :)



Do you know other solutions?

I have about 500000 tasks and with "mass delete records" I need many hours for erase all... (5000000/250 = 2000 clicks!)