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
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
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category