Right now I'm working on migrating a site from using an oracle database to use salesforce. For querying the data we are using the latest version of the salesforce rest API. Right now I'm facing a problem paginating results with an offset greater than 2000. I have seen quite a few questions on this topic but none of them seem to fit my problem.
So Here are the restrictions
WHERE ID > lastIdIntheResults LIMIT 20
because I need to sort my results by Name, sorting by Id would break the order that the client expects. So, do you have any suggestions?
Thanks
REST API's equivalent of SOAP API's queryMore
is done: false
and nextRecordsUrl: ...
in the response.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm
Here's my data queried via https://workbench.developerforce.com -> Utilities -> Rest Explorer:
And then the next one would be
And to change the "chunk size" without LIMIT/OFFSET you can use a HTTP header: Sforce-Query-Options: batchSize=200