Hi everyone, I have been working with NetSuite scr...
# general
m
Hi everyone, I have been working with NetSuite scripts, I found this code that worked for me, but I have a quite large query, and it is giving me a 504 error, does anyone happen to know how to solve it, this is the code that I found on the internet from script that I use and that serves me for the queries. I appreciate any help.
c
504 is gateway response timeout. The server is taking too long to process all the results. It looks like it runs recursively fetching 1000 results at a time until nothing returns. That could be an extremely large response if your looking, for example, for all transaction lines or similar. I would say your best bet is to refine your query. What is your use case for requiring such a large dataset? If that doesn’t work, you may want to try SuiteQL — I’ve found the performance to be superior to saved search
m
Cory thank you very much for your quick answer, I will investigate the two solutions given, happy day
m
Search API is useful if you set the script to call the data in batches. NetSuite will easily handle 1,000 at a time. Just have to tell your script to break and repeat after every 1,000 results. Or run the script by Month/Period/Custom Date Range… and modify as needed.
m
@Mathew Sorry for answering so far, thank you very much for your answer