Hi all, I am developing a simple restlet get reque...
# suitescript
v
Hi all, I am developing a simple restlet get request script. this restlet retrieves data from SavedSearch. In the SavedSearch, we have roughly 33k rows that we want to retrieve. But due to the restlet timeout limit of 5mins, it is timing out. The maximum rows that I can retrieve from SavedSearch to restlet by one call seems to be 16k. The record contains simple join columns. I am using
SuiteScript2.0
. Inside the loop iteration I am using
resultSet.getRange()
function to set the range and push the result the array. I wonder 33k is too many records to retrieved. Can someone give me any advice? Let me know if you need more information, I found MapReduce as an alternative solution but I need to use Restlet….
b
getRange is the slowest way to get large number of search results, try using use Search.runPaged instead
if thats too slow, then you may have to get your client to implement paging
1
v
@battk Thank you very much for the advice. Absolutely I will try right now and let you know
paging you mean from the savedSearch? I am sorry but I am completely new to NetSuites
b
as in you make the client making requests to the restlet request 1000 results at a time
or whatever number of results you deem appropiate
dont get them all at the same time
v
I understood now. Thank you very much for your help. I am trying it now. Have a good evening 🙂
r
Why is it slow, would you mind explaining? Because I am using getrange in too many scripts.
b
do a search getting 100k results using getRange and compared it to fetch