N/ui/message Module for Client Scripts in NetSuite
The N/ui/message module allows client scripts to create and display messages, enhancing user interactions in NetSuite.
TL;DR: The N/ui/message module in NetSuite provides client scripts with the ability to create and display messages on the user interface. This feature enhances the interaction experience by facilitating notifications and feedback directly on the page.
What is the N/ui/message Module?
The N/ui/message module is a fundamental SuiteScript 2.x module that enables developers to create message notifications within client scripts. These messages can notify users of important information, confirmations, or warnings, enhancing the user experience.
Key Members of the N/ui/message Module
The N/ui/message module comprises the following essential members:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Object | message.Message | void | Client scripts | Represents the Message object that gets generated via the message.create(options) method. |
| Method | message.create(options) | message.Message | Client scripts | Creates a message to be displayed or hidden at the top of the page. |
| Enum | message.Type | enum | Client scripts | Specifies the type of message (e.g., information, warning) to display, influencing its visual style. |
How to Use message.create(options)
To create a message, you'll call the message.create method with an options parameter that specifies the message title, content, type, and duration. Below is a syntax example:
1//Add additional code 2 var newMsg = message.create({3 title: "New Message Title", 4 message: "This is an new informational message", 5 type: message.Type.INFORMATION6 });7 // newMsg is the message.Message object created8//Add additional codeOptions Parameter Explained
The options parameter allows customization of the message:
- options.type: Required. Specifies the message type using the
message.Typeenum (e.g., INFORMATION, WARNING). - options.title: Optional. Sets the message title (defaults to an empty string).
- options.message: Optional. The content of the message (defaults to an empty string).
- options.duration: Optional. Determines how long the message should be displayed (default is 0, displaying until
Message.hide()is called).
Who This Affects
This feature is significant for:
- Developers: Enhances client-side scripting capabilities.
- Administrators: Improves user interface notifications and guidance.
- End Users: Gains better visibility into important alerts or confirmations.
Key Takeaways
- The N/ui/message module allows for dynamic messaging in client scripts within NetSuite.
- Messages can provide various types of notifications, influencing user interactions.
- Customization options enhance how developers manage user feedback and alerts in real time.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Do I need to enable a feature flag to use the N/ui/message module?
Can the N/ui/message module specify how long a message is displayed?
What types of messages can be displayed with the N/ui/message module?
Is the N/ui/message module available for all users of NetSuite?
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.
