@Shai Coleman it says:
“Using SuiteQL queries, you can return a maximum of 100,000 results *if the SuiteAnalytics Connect feature is disabled. If the feature is enabled, the number of results is unlimited.*”
And in this environment the feature is enabled, and even if it was not the issue is not the number of results returned (it’s around 20k items in this case) but the number of pages. As I wrote above, the bigger number I put into the pageSize parameter the more results I get. I can’t use Tims ROWNUM technique because it doesn’t use paged results so there’s a limit on 5k results, and I have much more than that:
“Keep in mind that when using this technique, you will still be limited to retrieving 3,000 rows at a time when making calls via SuiteTalk REST, and 5,000 rows when using the N/query module. You’ll have to take that into account when using this technique.”
When it comes to using IDs, can they be trusted? I know historically IDs in NetSuite are not 100% incremental and therefor a higher number is not always a newer record so you can sort on it properly..