Hi everyone, I am manipulating an invoice aftersu...
# suitescript
m
Hi everyone, I am manipulating an invoice aftersubmit and changing tax codes. However on large transaction the record.save() operation never succeeds and eventually the page times out. Attached is the code and the result in execution logs. Any hints on how to investigate/resolve?
t
Are you loading the record in standard mode? I feel like the standard is faster than the dynamic mode.
m
Yes. record is loaded in Standard Mode. (not explicitly but default without setting 'IsDynamic')
b
the slow unfavorable answer is find out what is causing the slowness
start by making your script edit and save the invoice without making any changes
if its still slow, the amount of data is not the cause
if that fails, then you want to work out how many lines you have to modify to cause the error
you may also want to see if modifying different fields on large numbers of sublists cause the problem
then go to netsuite support with details to see if they have a better answer
if you are very lucky, the answer is something simple, like your settings for enableSourcing or ignoreMandatoryFields is causing issues
s
What do you mean large? Many line items? Does your script also do something with them?
m
Many line items yes. 600+ where I set some suitetax fields to a different value. it does not consume Netsuite script points per line however
s
I think Map Reduce is the answer. Trigger it on afterSubmit.