0

My org has over 300 reports that have been identified as no longer needed, but that are associated with current dashboards. I need a quick way to delete just the associations between those reports and any dashboards.

I've tried using Data Loader to specifically delete the Dashboard Component records (based on ID) for these reports, but get the error "insufficient access rights on object id".

Is there any way to bulk-remove the association between reports and dashboards, so that the reports can be deleted?

2 Answers 2

0

There is no quick way to delete reports without unplugging the dashboard references. For the 'insufficient access rights on object id' error try checking below points.

  1. Check if the running user of the dashboard is active.
  2. Make sure Report type of the reports tied with dashboard is 'Deployed' status.
  3. You need to have access to the folder in which dashboard and respective report resides.

You might want to check Delete Multiple Reports at Once under Data Management.

Thanks

0

You can consider the below workarounds to achieve DashboardComponents deletion in bulk:

Using SOQL:

In Developer Console's Query Editor, execute the below query:

SELECT Id FROM DashboardComponent WHERE CustomReportId IN (SELECT Id FROM Report WHERE Owner.IsActive = FALSE and LastRunDate < LAST_N_DAYS : 180)

Select the returned results from the grid and click on the Delete button.

Few points to consider:

A bit of monitoring might be needed and it might get stuck but does the work. Keep refreshing the grid and repeat the steps till all the records get deleted.

Using Apex:

You can also create a Queueable class with a future(callout=true) method adding the DashboardComponent Object API with "Delete" method

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .