Hi all, I have a sceduled script in 1.0 that copie...
# suitescript
k
Hi all, I have a sceduled script in 1.0 that copies/updates all vendors to an external database. Tested it with a Netsuite account that has 200k vendors. The script itself does not have much of logic, loads a saved search, then uses a while loop to get 1000 results and do an http request to send them to the external DB. I am checking the governance and at about 8500 governance units I get the instruction limit error. Any ideas how can I save the day without moving to a MR?
b
you can try sharing the code, but i havent hit instruction count limits without doing binary operations or infinite loops
the general remedy for keeping a scheduled script is to use nlapiYieldScript (and make upgrading the script to ss 2.0 much harder)
or add logic to the script such that it can restart itself after rescheduling using nlapiScheduleScript
k
Untitled
That's a general idea of the code.
But the logic does not seem something that would fail
b
convertToModel ?
l
put your
requestVendors
into a temp_record, trigger M/R do the job
Oh sorry, missed that you don’t want create a MR
k
comverToModel is doing a mapping to an object (resembling a call) its has model.property = savedSearchResult.getValue("someColumn")
b
meh, i say decrease the step to 500 to double your point usage
k
That worths trying I think...
That was an amazing idea battk. Doing a last test but where it was failing at 20k now I pushed 100k and keep going. Thanks a lot
b
good thing too, im only willing to do easy changes for those type of errors
they can take forever to work out