Join Slack
Powered by
How can I get the number of search results from th...
# suitescript
c
cja
08/07/2020, 1:07 PM
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
SimonC
08/07/2020, 1:28 PM
could try .run().getRange({ start: 0, end: 1000 }).length
b
battk
08/07/2020, 2:07 PM
a weakness of a
ResultSet
is that it does not have a direct way to get the count.
a
Azi
08/07/2020, 2:10 PM
I am confused. It returns a regular js array. What wrong with
.length
as
@SimonC
suggested?
b
battk
08/07/2020, 2:11 PM
if there are 2100 results, getting the length of the first 1000 results like in his example will return 1000
s
SimonC
08/07/2020, 2:11 PM
sure, you could always implement the recursive search if you know it's a large dataset though
a
Azi
08/07/2020, 2:18 PM
@SimonC
☝🏽 As Simon said
19
Views
Open in Slack
Previous
Next