Modules

filter

 

Objects/Functions

module (N/ui/serverWidget)

SuiteScript 2.0

Form.addPageInitMessage(options)

{Form}.addPageInitMessage({message: {message.Message*}})

N/ui/serverWidget Module
Form.addPageInitMessage()
Method Description: Shows a message when users view a record or Suitelet. User event context can be used to control whether the message is shown on records in view, create, or edit mode (not applicable for Suitelets). See context.UserEventType. This method is called during a beforeLoad user event or in a Suitelet, and the message is later displayed on the client side, after the pageInit script is completed.
Returns: void
Supported Script Types: SuiteScript 2.0 Suitelet Script Type and SuiteScript 2.0 User Event Script Type (beforeLoad(scriptContext))
Governance: None
Module: N/ui/serverWidget Module
Since: 2018.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Form.addPageInitMessage(options)

Example:

// Code Example 1
//Add additional code
//...

// Options object as parameter
form.addPageInitMessage({type: message.Type.INFORMATION, message: 'Hello world!', duration: 5000});

// Message object as parameter
var messageObj = message.create({type: message.Type.INFORMATION, message: 'Hello world!', duration: 5000}); form.addPageInitMessage({message: messageObj});

// Show message when the record is in view mode
function beforeLoad(context) {
if(context.type === 'view')
context.form.addPageInitMessage(messageOptions);
}
//...
//Add additional code

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