Rest API – Which has higher priority in a SOQL query, LIMIT clause OR Sforce-Query-Options: batchSize?
When a SOQL query has both a LIMIT clause and a Sforce-Query-Options: batchSize with different but valid values, which one of these gets a higher precedence?
- A query with only LIMIT clause
SELECT ID from foo__c LIMIT 1000
- Another query with a LIMIT clause and the
Sforce-Query-Options: batchSizeheader i.e.
Sforce-Query-Options: batchSize=250
SELECT ID from foo__c LIMIT 1000
The second query with a batchSize=250 header and limit clause of 1000 only returns 250 records.
Does it mean batchSize header has a higher precedence over the LIMIT clause?
Read more here: Source link
