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
Matt HammelMatt Hammel 

Display a banner across the top of specific reports

I am trying to delete almost 1400 stale reports in our salesforce org. The business wants me to add a note to the title of the report that it is slated for deletion. Most report titles don't have the available space to add a meaningful note, plus there are 1400 of them.  I am hoping that I could add a banner to each report marked for deletion and am thinking that would have to be Visualforce. Not sure how I would trigger the banner. Maybe based on the folder? We are going to move all of these reports to a Slated for Deletion folder. Is this possible? Is there an easier way?
Alain CabonAlain Cabon
Hi Matt,

The object Report can NOT be updated with SOQL and apex so the steps needs retrievals and deployments of the reports metadata themselves (quite heavy but it is the only way).

The developer name must be unique for each report. It is the physical name of the report in fact.
The name (label) in the other hand can be changed and it is totally independent of the developer name.

I have tested this steps:

For changing the names (banner) :

1) Retrieve the reports metadata with the workbench.
2) Change the <name> like below into the files :  <my_report_name>.report   (you can use a regex and PSPAD or NotePad++)

User-added image

3) Create a new deployment big package with the current folder and the new names but the physical files names of the reports must be exactly as before. There are the developer names of the reports and there are unique but they can change of folder.

4) Deploy the package zip with the workbench. Result: all the targeted deployed reports have now "(will be removed)" at the end of their names (seen by the users). It is not a "banner" but the name of the report itself has changed.

For the deletions : 

1) Create a new folder "Reports to be deleted" 

2) Move all the files : <my_report_name>.report to the new folder on your disk.  <my_report_name> is the developer name (unique name).

3) Create a new deployment big package zip file with the new folder "Reports to be deleted"  and the physical files names of the reports must be exactly as before. There are the developer names of the reports and there are unique but you can move them into a new folder during a deployment

5) Mass deletion of the report with the standard option choosing the folder  "Reports to be deleted" (a sure method even it is semi-manual)

User-added image

That seems very heavy but it is the only way.  eyescreams found a workaround but it doesn't work anymore and Daniel Ballinger is an expert when you want to play with the metadata (perhaps one or two steps less) but the procedure above is quite sure.

https://salesforce.stackexchange.com/questions/12077/how-to-mass-delete-old-reports-options
 
Alain CabonAlain Cabon
​the steps need retrievals and deployments of the reports metadata themselves (quite heavy but it is the only way).

3) Create a new deployment big package zip file with the new folder "Reports to be deleted"  and the physical files names of the reports must be exactly as before. They are the developer names of the reports and they are unique but you can move them into a new folder during a deployment.

(sorry for my broken English and I hope you will understand the technical steps)