2

enter image description here

How do I get the SOQL query for this report?

4

There is no way to get the SOQL automatically generated for you. It is entirely possible that a given report cannot be represented by a single SOQL query.

Here are some ideas.

  1. Analyze the report and determine what a SOQL query or multiple SOQL queries with Apex to process and combine their results would be.

  2. Use the Analytics API to run the report and analyze the results. The Analytics API is available via Apex as well as via REST.

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.