I have seen several question that ask the opposite, how to overcome that limit. I need smaller response because some downstream issue I have with very long responses. I cannot use the LIMIT clause because that limits the full response but I still need to loop with nextRecordsUrl on the full response. I just need to do it with a longer loop on shorter responses.
-
3Can you elaborate more on your question? Code samples would also be welcome. – Sebastian Kessel Oct 17 '16 at 18:51
-
Please do not edit this question. An Adrian Larson edited my question to have its meaning completely reversed. I had to edit it back. Weird that questions can be edited by others. – Moshe Cohen Oct 19 '16 at 5:59
Use the Query Options Header to adjust the batchSize. You can reduce it down to 200 records. The default is 2,000 records.
Salesforce may reduce the batch size automatically if you select particularly large fields.
batchSize
—A numeric value that specifies the number of records returned for a query request. Child objects count toward the number of records for the batch size. For example, in relationship queries, multiple child objects are returned per parent row returned.
Example
Sforce-Query-Options: batchSize=1000
For reference, the same concept also applies to the SOAP API -- Change the Batch Size in Queries.