Featured image of post Salesforce Chatter Bulk Delete Command

Salesforce Chatter Bulk Delete Command

Salesforce Chatter Bulk Delete Command

This is a command to delete all posts and attachments in Salesforce Chatter. Open the Developer Console, select “Open Execute anonymous Window” from the Debug menu, paste the following code, and execute it. I personally use this when the organization’s storage capacity is running low.

1
2
3
4
5
6
delete [select id from FeedItem];
delete [select id from FeedAttachment];
delete [select id from ContentDocument];

// Empty the recycle bin
database.emptyRecycleBin([select id from ContentDocument where IsDeleted = true ALL ROWS]);
comments powered by Disqus