All notes
NetSuite2 min readUpdated August 4, 2026

Governance Units: Why a Script Stops on Its Own

NetSuite caps how much work a single script execution may do. Understanding that cap explains errors that only appear once the data has grown.

NetSuiteGovernanceSuiteScriptPerformanceMap/Reduce

NetSuite is shared by many accounts, so no script may consume resources without limit. Every API call costs a number of units, and every script type has an allowance. Once the allowance runs out, execution stops with SSS_USAGE_LIMIT_EXCEEDED.

This is why a script can pass every test and then fail months later: the logic did not change, the volume of data did.

Allowance per script type

Script typeUnit allowance
Client Script1,000
User Event Script1,000
Suitelet1,000
Workflow Action Script1,000
RESTlet5,000
Scheduled Script10,000
Map/Reduce10,000

Cost of the operations you use most

OperationUnits
search.lookupFields1
Custom record — load2
Custom record — save4
Standard record — load5
Standard record — save10
Transaction — load10
Transaction — save20
search.run() / each()10

The full list lives in NetSuite Help under SuiteScript 2.x API Governance. What matters from the table above is the ratio: reading a couple of fields with lookupFields is far cheaper than loading a whole record, and saving a transaction is the most expensive thing you routinely do.

How to bring usage down

  • Use search.lookupFields when you only need to read a few fields, not record.load.
  • Use record.submitFields to change a couple of fields without loading the whole record.
  • Do not call an API inside a loop when the result could be fetched once outside it.
  • For large volumes, move to Map/Reduce — the allowance is counted per unit of work rather than once for everything.
  • Watch the remaining allowance while running and stop cleanly before it is exhausted.
Checking the remaining allowance before continuing
define(['N/runtime'], (runtime) => {
  const script = runtime.getCurrentScript();

  if (script.getRemainingUsage() < 100) {
    // leave room to close the work tidily
    log.audit('Governance', 'Units running low, stop the batch here.');
    return;
  }
});

More notes