i.e. ``` function yieldScript(state) { if (s...
# general
s
i.e.
Copy code
function 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…
Copy code
var state = nlapiYieldScript()
yieldScript(state)
state = null