Scripting Governance
To prevent scripts from consuming excessive resources or running out of control, limitations are placed on scripts:
-
Time Limit — If a form script runs for more than 5 seconds (not including wsapi call time) it is automatically terminated with a form error. If a request (all scripts triggered by the same form save) uses more than 60 seconds of wsapi time it will also be automatically terminated.
Note:Scheduled scripts are allowed 1 hour of JS runtime and 1 hour of wsapi.
-
Units Limit — NSOA functions are assigned a unit value. Each time an NSOA function is called its unit value is consumed. A script is allowed to consume a maximum of 1000 units with each run before it is automatically terminated with a form error. You can determine how many units you have remaining by calling NSOA.context.remainingUnits(). See the table below for the unit value of each NSOA function.
Note:Scheduled scripts are allowed 1, 000, 000 units.
-
SendMail Limit — Additional limits are placed on the NSOA.meta.sendMail(message) function. Form Scripts are allowed to send a maximum of 3 emails. Scheduled Scripts are allowed to send a maximum of 100 emails. The email subject is trimmed to the first line passed.
Important:There is a maximum body length set for your emails sent by form and scheduled scripts. Email messages with bodies above that maximum body length are not sent.
The maximum body length is set to 30,000 characters by default and can be changed to suit your requirements. To review or to increase the maximum body length set for your account, contact OpenAir Customer Support.
NSOA Function |
Units |
---|---|
0 |
|
|
1 |
4
Note:
Calls to NSOA.meta.log(severity, message) with the severity parameter set to “debug” or “trace” do not consume units but are limited to a maximum of 1000 per script. |
|
10 |
|
10 for each page loaded into iterator on demand (max 1000 items per page) |
|
20 +10 for each additional object passed. |
|
40 +20 for each additional object passed. |
|
1000 |