How can I get the number of search results from th...
# suitescript
c
How can I get the number of search results from the result of search.run()? search.runPaged() has a count property but the NS docs (https://docs.oracle.com/cloud/latest/netsuitecs_gs/NSAPI/NSAPI.pdf) don't mention a count property for run(). I created a question here: https://stackoverflow.com/questions/63302695/how-to-get-the-number-of-search-results-from-search-run
s
could try .run().getRange({ start: 0, end: 1000 }).length
b
a weakness of a ResultSet is that it does not have a direct way to get the count.
a
I am confused. It returns a regular js array. What wrong with
.length
as @SimonC suggested?
b
if there are 2100 results, getting the length of the first 1000 results like in his example will return 1000
s
sure, you could always implement the recursive search if you know it's a large dataset though
a
@SimonC ☝🏽 As Simon said