Modules

filter

 

Objects/Functions

module (N/runtime)

SuiteScript 2.0

Script.getRemainingUsage()

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=Script.getRemainingUsage() for more information.

N/runtime Module
Script.getRemainingUsage()
Method Description: Returns the number of units remaining (per governance limitations) for the currently executing script. For more information, see SuiteScript Governance.
Returns: number
Supported Script Types: Client and server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/runtime Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Script.getRemainingUsage()

Example:

// Code Example 1
// Add additional code
//...
var scriptObj = runtime.getCurrentScript();
log.debug('Remaining governance units: ' + scriptObj.getRemainingUsage());
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4296661153.html