SOQL: 50,000 Record Limit Applies With Count()
The Salesforce Partner or Enterprise API allows one to execute a SOQL query against it. Since it has paging built into it using a cursor behind the scenes, it's not subject to the 50,000 row limit. One can invoke the Query endpoint with the count SOQL query to get the true number of results.
For one-off counts, often done while troubleshooting or to determine the design approach, issue the SOQL query using Workbench or through the Developer Console. Behind the scenes, they're using the Salesforce APIs to execute the query so they won't run into the 50,000 row limit.
As part of a Salesforce feature, one can write Apex that invokes a Salesforce API to get the count. See my Calling Salesforce Web Services Using Apex Cookbook Recipe, for detailed instructions on how to implement that.
Read full article from SOQL: 50,000 Record Limit Applies With Count()
No comments:
Post a Comment