2

I want to find if a particular object/field is used in any reports.

Ideally I would like to parse through all of the reports, then all of the fields and attempt to match the Object/Field Name.

It appears that all the information I need is available within the XML files associated with the reports which I suspect are available via the Metadata API.

What do you think might be the most straightforward way to accomplish this? Maybe trying to grab and parse the XML files is overkill. I'd like to do this via APEX rather than using the SOAP/REST API's.

1

At this point there isn't any direct way to access the details for a report such as the columns or criteria. You can access them indirectly by calling the Metadata API from Apex, but assuming you have more than a trivial number of reports you'd hit governor limits instantaneously (reports tend to be the most numerous metadata type in an org).

In the past I've done this using ant to pull down all the reports and a ruby script to their criteria into a CSV file. One of the big problems you'll quickly run into is that you can't see any personal reports meaning you'll only be able to tell if the field is present in shared reports. Other issues include dealing with breaking up the retrieve call if the max response size is exceeded.

  • I feel like this will probably be the route I have to go. I used the IDE to download the reports Metadata to my hard drive and then use a text search utility which lists all documents where a particular search string (API Name) is found. Its not ideal, but should get the job done. – Joseph U. Sep 4 '13 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.