+ Start a Discussion
sandeep@Salesforcesandeep@Salesforce 

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,
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_report.htm


But you can do through Force.com ANT Tool,
https://developer.salesforce.com/page/Propagating_Destructive_Changes
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.