In Saved search formula (numeric) is there a way t...
# suitescript
e
In Saved search formula (numeric) is there a way to just get the rownum between a certain rownum like 101 - 200? I was able to use rownum like less than 100. The 'between' criteria doesn't seem to work
e
I've done this using a suitelet where it has fields for the batch number and the number of rows per batch. It runs the search, gets the count, and then edits the search to include the ids in the desired batch. (internalid anyof '1,2...1000') You might be able to otherwise use SuiteQL to do a between clause on the internal id.
a
If you use suiteql you can use a sub query.
SELECT tranid FROM
(SELECT Transaction.tranid,rownum as innerrownum,from Transaction) WHERE Innerrownum BETWEEN 100 And 200
Of course to get meaningful results we need to order it. But rownum is not tied to the order unless we use another sub query.
Copy code
SELECT tranid from
(SELECT tranid,rownum as innerrownum FROM
(SELECT Transaction.tranid
from Transaction ORDER BY transaction.trandate)) 
 WHERE innerrownum BETWEEN 100 And 200
Perhaps @tdietrich can come up with a smarter way to do it.
t
@Alan Fitch That's similar to the pagination method that I mention in this post - https://timdietrich.me/blog/netsuite-suiteql-pagination/ - and that the updated SuiteQL Query Tool ( https://timdietrich.me/blog/netsuite-suiteql-query-tool-suitelet-beta-20210714/ ) uses as well.