0

I noticed that through my browser console I was able to view the source code for the SuiteScript API. Each API funciton had a function call within in that looked like: nsapiLogUsage( 'nlapiLoadRecord', type ).

When I removed this, and inserted the entire function into my own script, and then called the function, governance units no longer mattered. My code executed on, and on, and on, with no restrictions. I am currently writing a scrip that will execute against 300k records, so governance units have been a huge issue to deal with.

Are governance units in place only to keep long running code from executing, or are there more serious consequences to not having governanc units?

2 Answers2

1

Governance is a way to limit script execution to avoid the overcomsuption of resources server side, as metioned in the documentation:

SuiteScript

API Governance

Perhaps the behavior your are experiencing is not the intended. But actually it is not a feature that is considered for the web browser.

pdjota
  • 3,163
  • 2
  • 23
  • 33
0

Each script type has its own usage limit. See Script Usage Limits
For instance, a client script has 1000, a scheduled script has 10000, and so on.

Each API call costs governance units consuming the usage allowed.
An error is thrown once the limit is reached.

If you are trying to update 300k records, I suggest you use a scheduled script because you can reset the governance units here using nlapiYieldScript().

earj
  • 76
  • 3