sethcall
10/03/2016, 4:40 PMfunction yieldScript(state) {
if (state.status == 'FAILURE') {
nlapiLogExecution('ERROR', "Failed to yield script, exiting: Reason = " + state.reason + " / Size = " + state.size);
if (state.reason == 'SS_DISALLOWED_OBJECT_REFERENCE') {
nlapiLogExecution('ERROR', "Disallowed object type: " + state.information);
}
throw "Failed to yield script";
} else if (state.status == 'RESUME') {
nlapiLogExecution('AUDIT', "Resuming script because of " + state.reason + ". Size = " + state.size);
}
state = null;
}
… later…
var state = nlapiYieldScript()
yieldScript(state)
state = null