0

I have one new requirement where My client wants to retrieve large data set (~80K records) from Salesforce daily. I have created rest web service but it returns only 2k records.

for 80k records, do client needs to call 40 times in a day to retrieve all records?

Please can you share your inputs on above?

1

I would suggest using the Bulk API

0

With the Composite Rest API you can technically retrieve up to 60k records only two request!

This is a bit of a cheat in that it relies on "guessing" the nextRecordsUrl of the query and only works without child relationships.

In those cases, you can still leverage Composite API to reliably pull down 10k records per query.

Doing so would look something like this:

{
    "compositeRequest": [
        {
            "method": "GET",
            "url": "/services/data/v42.0/query?SELECT Id, (SELECT Id FROM Contacts) FROM Account",
            "referenceId": "req1",
        },
        {
            "method": "GET",
            "referenceId": "req2",
            "url": "@{req1.nextRecordsUrl}"
        },
        {
            "method": "GET",
            "referenceId": "req3",
            "url": "@{req2.nextRecordsUrl}"
        },
        {
            "method": "GET",
            "referenceId": "req4",
            "url": "@{req3.nextRecordsUrl}"
        },
        {
            "method": "GET",
            "url": "@{req4.nextRecordsUrl}"
        }
    ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.