Can someone please help me to write SOQL query to get all records for any custom report like "https://xxxxxxx.my.salesforce.com/00O0L000003q8C5" so here "00O0L000003q8C5" is my report id and i need to write SOQL query to pull all records for this report via SOQL. thanks
1 Answer
You can't write a SOQL query that returns results for any arbitrary report. Each report is different and would reduce to a different SOQL query.
You can use the Reports and Dashboards API to programmatically execute report runs and extract the resulting data. This API is accessible in Apex or via the REST API.
Alternately, you can analyze each report individually and build a SOQL query that yields the same records as the report run.