Script Object Members in SuiteScript for Developers
N/runtime module details runtime settings, session, and user data for script operations.
The N/runtime module in NetSuite is pivotal for handling runtime settings related to scripts, sessions, and users. This module allows developers to access runtime information, set session keys, and verify feature availability within a NetSuite account.
How Do Script Object Members Work in NetSuite?
The Script object members within the N/runtime module enable developers to manage and access various runtime settings specific to the executing script.
Key Methods in Script Object Members
Script.getParameter(options): Returns the value for a parameter of the executing script, which can be a number, date, string, or boolean.Script.getRemainingUsage(): Provides the remaining execution units under governance rules.
Essential Properties
Script.apiVersion: Read-only; shows the runtime version of the current script.Script.bundleIds: Read-only; an array of bundle IDs relevant to the script.Script.deploymentId: Read-only; displays the deployment ID for server scripts.Script.id: Read-only; returns the ID for the current script.Script.logLevel: Read-only; indicates the logging level for server scripts.Script.percentComplete: Indicates the execution progress percentage for scheduled scripts.
Who This Affects
- Developers: Those implementing or managing scripts will benefit from understanding runtime contexts.
- Administrators: Need to ensure correct script execution and feature enabling.
Key Takeaways
- N/runtime module is crucial for runtime script management in NetSuite.
- Allows setting session keys and checking feature availability.
- Script object members provide methods for parameter retrieval and runtime management.
- Ensures adherence to governance limits via usage metrics.
Frequently Asked Questions (4)
How can I access user-specific configurations in a script using the N/runtime module?
Are there any restrictions on accessing remaining governance units in SuiteScript?
Is there a way to determine if a feature is enabled in the current NetSuite account using SuiteScript?
What information can be retrieved about a script's execution using the Script object?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Custom Tool Script Enhancements in NetSuite
Custom tool scripts in NetSuite gain execution log support and a new management page in February 16, 2026.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
