Netsuite Restlet Pagination Capped at 1800

159 Views Asked by At

We are using a RESTlet script to retrieve Netsuite transaction records, and are running to an issue where we can't make calls upon hitting page 1800 (using 1000 results per page). Anything above page 1799 returns a 400 "Bad Request" error.

Here is an example of our get request URL: https://XXXXX.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=X&deploy=X&page=1800

I can't find any examples of this being an issue for others, nor can I find anything on the significance of an 1800 page limit for a RESTlet (only a max of 1000 pages for SuiteQL). 1800 is a peculiar number to cap at, so I'm not exactly sure if this is a netsuite internal limit.

Any ideas?

Thanks!

1

There are 1 best solutions below

0
bknights On

That's a lot of records and very likely some sort of arbitrary internal limit.

You can likely ease that and get some faster results if you can sort by by internalid and/or lineuniquekey (if you return line information) and then pass the last received lineuniquekey or internalid back to the restlet:

https://XXXXX.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=X&deploy=X&luk=X&lastId=Y

and have your script include those when present.

note if you use both then your search filters would include something like:

['internalid', 'greaterhthanorequel', lastId],
'AND',
['lineuniquekey', 'greaterthan', luk]