Trying to retrieve more than 2500 records from a DE. My thought is to have a for loop (to process the recordset) within a while loop (to retrieve records).

var data;
var recordCount = 0;

do {    
    data = rDE.Rows.Retrieve(complexfilter);
    recordCount = data.length;

    for( i = 0; i < recordCount; i++) {
        var rLeadId = data[i].LeadId;
        Write(i + " : " + rLeadId + "<br/>")
} while (recordCount > 0) 

The error is:

throw "There was an error retrieving the rows."

1 Answer 1


This process does work. I was forgetting to update the data so the complexfilter would return a new dataset.

  • Hi! I would like to know if this limitation still exists as I am facing a similar problem with SSJS. I have elaborated more here: salesforce.stackexchange.com/questions/274369/… So I am wondering if adding the do-while loop to your code solved your problem. Thank you for your time in advance! Aug 21, 2019 at 8:32

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.