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

How can I delete reports in bulk ?

Arunkumar RArunkumar R
Hi Sandeep,

You can't delete Reports in a bulk. Because Report Object doesn't allow any DML Operations.

It allows only the following operation,
describeSObjects(), query(), retrieve(), search()

For more details read the below article,

But you can do through ANT Tool,
Tzemach Aronow 1Tzemach Aronow 1
DataLoader won't help you because the Report table is not "deletable".

If you have exported a list of obsolete Report Ids (for example last run date over 1 year ago) you can use a simple trick to wipe them.

Access https://(salesforce instance)/(report Id)?delrep=1 and it will attempt to delete it (delrep is the name of "Delete" button on the report page). If you're familiar with clickety-click tools like Selenium - awesome, otherwise generate links in Excel and ask an intern for assistance ;)

It will still fail if report is used on a Dashboard and as far as I know fastest way to detect such dependency is Eclipse / Metadata API (because you just search directory full of XMLs looking for Report_Name_With_Underscores)... It's a very good initial sweep nonetheless.