Can someone help me, how to create the ss2.0 saved...
# suitescript
j
Can someone help me, how to create the ss2.0 saved search for more than 4k record?
b
do you want to learn the old version of searching that is easier to write but has less features and costs more points
or the new version of searching that is harder to write but has more features and costs less points
you evidently already learned the least flexible way of searching
m
@battk which version is this? 😃
var pagedData = search
.create({...})
.runPaged({ pageSize: 1000 });
pagedData.pageRanges.forEach(function(pageRange) {
pagedData.fetch({ index: pageRange.index }).data.forEach(function(result) {
console.log(result)
});
});
b
the new version
😄 1
j
can you teach me how I can do the new version?
basically michoel's example code
you create the search but instead of using the run method, you use the runPaged method (usually while specifying a page size of 1000)
runPaged returns a PagedData object which contains metadata about the search results (such as the count of search results)
importantly, the search results are grouped into pages (with information contained within the pageRanges property)
you use the fetch method of your PagedData to get a Page of search results
and you use the data property of the Page to access the array of search results
usually you iterate though the page range to individually fetch each Page of search results
j
✋
thanks.. i'll just read this first.
Thanks @battk!!!
s
(using NFT)
e
@JM log the governance points before and after running the @michoel version, and you will notice that it costs just 5/10 points, it was one of the best improvements in S.S. 2.0