I understand there is limitation of 5000 records r...
# suitescript
m
I understand there is limitation of 5000 records return by suitescript. But is there any way by some logic I can return all records?
n
Copy code
function getAllSearchResult(searchObject) {
            var pages = searchObject.runPaged({
                pageSize: 1000
            }); //5
            var result = [];
            for (var i = 0; i < pages.pageRanges.length; i++) {
                //log.debug(i, scriptObj.getRemainingUsage() + ', ' + new Date());
                var singlePage = pages.fetch({
                    index: i
                }); //5
                //log.debug(i, scriptObj.getRemainingUsage() + ', ' + new Date());
                for (var j = 0; j < singlePage.data.length; j += 1) {
                    result.push(singlePage.data[j]);
                }
            }
            return result;
        }
i dont repeat myself except reusing this piece of code.
but do have your eyes on the getRemainingUsage()
m
and can you give example what did you pass in searchObject?
how can I dynamically pass the object to above function?
b
you really want to gain an understanding of the technologies used be these scripts
nzy provided a sample using N/search, which is backed by Searches
an alternative is N/query, which is back by Workbooks
a non suitescript alternative is Connect, which are likely sql views