How to read more than 1000 records return from netsuite search results in c#?

前端 未结 3 620
北恋
北恋 2021-01-24 14:00

I am not able read all records. It reading only 1st pageindex records. I want read all reacords of all pages. Totalrecords are 2055 but 1st 1000 records only reading. Kinldy som

3条回答
  •  清歌不尽
    2021-01-24 14:14

    Not sure how to do it using C# and web services but this is how I did it using SuiteScript

    var savedSearch = nlapiLoadSearch(recordType, searchId);
    var resultset = savedSearch.runSearch();
    var returnSearchResults = [];
    var searchid = 0;
    do {
        var resultslice = resultset.getResults(searchid, searchid + 1000);
        for ( var rs in resultslice) {
            returnSearchResults.push(resultslice[rs]);
            searchid++;
        }
    } while (resultslice.length >= 1000);
    
    return returnSearchResults;
    

提交回复
热议问题