burkybang
08/14/2023, 8:16 PMnlapiSubmitRecord()
sometimes with RCRD_HAS_BEEN_CHANGED. Just before that, there's a loop that sets values on the record's lines. In the loop, there's also a check to get the governance usage and yield if it's less than 200 remaining.
My theory is it's reloading the record (nlapiLoadRecord()
) after it yields. Can anyone confirm my theory? Is a SuiteScript 1.0 scheduled script smart enough to not reload the record when yielding?Nathan L
08/14/2023, 8:36 PMburkybang
08/14/2023, 8:39 PMBenjamin Jung
08/14/2023, 9:17 PMburkybang
08/14/2023, 9:21 PMnlapiGetContext().getRemainingUsage();
Before the script reaches the limit, you can yield it. This causes the current memory usage to get saved into storage and your script gets restarted with the memory reloaded from storage.
nlapiYieldScript();
Nathan L
08/14/2023, 9:24 PMBenjamin Jung
08/16/2023, 4:09 PMburkybang
08/16/2023, 4:11 PMNElliott
08/28/2023, 7:52 AM