I have 300 reports in my organization, and i want to see reports for sobject say xyz__c.
I tried to retrieve it using soql but there is no relationship between sObject and Report.
Any pointers/suggestions would greatly appreciated.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
As far as I know it can't be done with SOQL.
You probably could try with Analytics API but it has some limitations.
The "old school" way would be to download all report types and report definitions to Eclipse IDE (or with any other tool of your choice). If you'd have > 5,000 reports the retrieval would have to be split into chunks - for example fetch few folders at a time.
Report definitions will be shown as XML files (sample is at the bottom of Metadata API page for Report object).
You'll then be able to run text searches on the XML files (Ctrl+H in Eclipse but you could also use Windows "Find in files" or anything really). Search for your custom object's API name (
Xyz__ - ideally without the
c at the end because you might see
Personally I like Notepad++ "find in files" - easy to select the search results and paste to text file or Excel...
If that's too much work - go to the object's definition, clear the "allow reports" checkbox and soon your users will tell you which reports are related to that object ;)