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
Andrew Tzikas 9Andrew Tzikas 9 

Retrieve available fields under report type (MDAPI)


Is it possible to retrieve all of the standard fields that are listed on a standard report type.


For the OpportunityLead Report Type, I believe all Standard Lead Fields are available, however, not all Opportunity fields are.


Is there a place in the Metadata API where you could query the fields that are available under each report types?

VinayVinay (Salesforce Developers) 
Hi Andrew,

Custom Report Type does not contain all of the expected fields to add, you must edit the layout of the report.

https://help.salesforce.com/s/articleView?id=000384387&type=1

Let me know if this is the issue or kindly elloborate more on this.

Also Custom Report Type cannot be queried using SOQL.

https://ideas.salesforce.com/s/idea/a0B8W00000GdnDHUAZ/custom-report-type-from-apex-code-or-soql-query

Thanks,
Andrew Tzikas 9Andrew Tzikas 9

What about Standard Report Types. Is there a place where we can either 1) query what standard fields are going to be present in each custom report type or 2) is there a place where we can find this out and then bake into code? 

For Example with the OpportunityLead Report - I would want to know which standard fields I can always count on seeing both on the Lead and Opportunity object for this report type.