N/runtime Module
Use the N/runtime module to view runtime settings for the script, the session, or the user. You can also use this module to set a session key and to see whether a particular feature is enabled in your account.
In This Help Topic
N/runtime Module Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Client and server scripts |
Encapsulates the runtime settings of the currently executing script. |
|
Object |
Client and server scripts |
Encapsulates the user session for the currently executing script. |
||
Object |
Client and server scripts |
Encapsulates the properties and preferences of the user currently executing the script. |
||
Method |
Client and server scripts |
Returns a runtime.Script object that represents the currently executing script. |
||
Client and server scripts |
Returns a runtime.Session object that represents the user session for the currently executing script. |
|||
Client and server scripts |
Returns a runtime.User object that represents the properties and preferences of the user currently executing the script. |
|||
boolean |
Client and server scripts |
Indicates whether a particular feature is enabled in a NetSuite account. These are the features that appear on the Enable Features page. |
||
Property |
string (read-only) |
Client and server scripts |
The account ID for the current user. |
|
string (read-only) |
Client and server scripts |
The country for the current company. |
||
string (read-only) |
Client and server scripts |
The current environment in which the script is executing. This property uses values from the runtime.EnvType enum. |
||
string (read-only) |
Client and server scripts |
The trigger of the current script. This property uses values from the runtime.ContextType enum. |
||
number (read-only) |
Client and server scripts |
The number of processors available to the current account. |
||
number (read-only) |
Client and server scripts |
The number of scheduled script queues available to the current account. |
||
string (read-only) |
Client and server scripts |
The version of NetSuite that the method is called in. For example, this property in an account running NetSuite 2023.2 is 2023.2. |
||
Enum |
enum |
Client and server scripts |
Holds the context values for script triggers. This is the type for the runtime.executionContext property. |
|
enum |
Client and server scripts |
Holds all possible environment types that the current script can execute in. This is the type for the runtime.envType property. |
||
enum |
Client and server scripts |
Holds the user permission level for a specific permission ID. This is the type returned by the User.getPermission(options) method. |
Script Object Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
number | Date | string | boolean |
Client and server scripts |
Returns the value of a script parameter for the currently executing script. |
|
number |
Client and server scripts |
Returns the number of units remaining (per governance limitations) for the currently executing script. |
||
Property |
string (read-only) |
Client and server scripts |
The current script’s runtime version. |
|
Array (read-only) |
Client and server scripts |
An array of bundle IDs for the bundles that include the currently executing script. |
||
string (read-only) |
Server scripts |
The deployment ID for the script deployment of the currently executing script. |
||
string (read-only) |
Client and server scripts |
The script ID for the currently executing script. |
||
string (read-only) |
Server scripts |
The script logging level for the currently executing script. |
||
number |
Client and server scripts |
The percent complete for the current scheduled script execution. This value will appear in the % Complete column on the Scheduled Script Status page. |
Session Object Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
string | null |
Server scripts |
Returns the user-defined session object value associated with the session object key. Both the session object value and associated key are defined using Session.set(options). |
|
void |
Server scripts |
Sets a key and value for a user-defined session object. |
User Object Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
string |
Client and server scripts |
Returns a runtime.Permission user permission level for the specified permission. |
|
string |
Client and server scripts |
Returns the value of a NetSuite preference. Currently only General Preferences and Accounting Preferences are exposed in SuiteScript. For more information about these preferences, see General Preferences and Accounting Preferences. |
||
Property |
number(read-only) |
Client and server scripts |
The internal ID of the currently logged-in contact. |
|
number (read-only) |
Client and server scripts |
The internal ID of the department for the current user. |
||
string (read-only) |
Client and server scripts |
The email address of the current user. |
||
number (read-only) |
Client and server scripts |
The internal ID of the current user. |
||
number (read-only) |
Client and server scripts |
The internal ID of the location of the current user. |
||
string (read-only) |
Client and server scripts |
The name of the current user. |
||
number (read-only) |
Client and server scripts |
The internal ID of the role for the current user. |
||
string (read-only) |
Client and server scripts |
The string value of the center type, or role center, for the current user. |
||
string (read-only) |
Client and server scripts |
The custom scriptId of the role for the current user. |
||
number (read-only) |
Client and server scripts |
The internal ID of the subsidiary for the current user. |