Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

How do I get the SOQL query for this report?

share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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