message.create(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Creates a message that can be displayed or hidden near the top of the page.

Returns

message.Message.

Supported Script Types

Client scripts

For more information, see SuiteScript 2.x Client Script Type.

Governance

None

Module

N/ui/message Module

Since

2016.1

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.type

message.Type

required

The message type. Set this value using the message.Type enum.

2016.1

options.title

string

optional

The message title. This value defaults to an empty string.

2016.1

options.message

string

optional

The content of the message. This value defaults to an empty string.

2016.1

options.duration

int|string

optional

The amount of time, in milliseconds, to show the message. The default is 0, which shows the message until Message.hide() is called. If you use a string, it will be parsed to a number.

If you specify a duration for message.create() and message.show(), the value from the message.show() method call takes precedence.

2018.2

Syntax

Important:

The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/ui/message Module Script Sample.

                //Add additional code 
      ...
    var myMsg = message.create({
        title: "My Title", 
        message: "My Message", 
        type: message.Type.CONFIRMATION
    });
    ...
       //Add additional code 

          

Related Topics

N/ui/message Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices