Modules
Objects/Functions
SuiteScript 2.0
{dialog}.create({buttons: {string[]},title: {string},message: {string}})
N/ui/dialog Module
dialog.create()
Method Description:
Creates a dialog with specified buttons.
Returns:
Promise Object. To run a callback function when a button is pressed, pass a function to the then portion of the Promise object. The value of the button pressed is passed to the callback.
Supported Script Types:
Client scripts
For more information, see SuiteScript 2.0 Client Script Type.
Governance:
None
Module:
N/ui/dialog Module
Since:
2016.1
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=dialog.create(options)
Example:
// Code Example 1
//Add additional code
...
var options = {
title: 'I am a Dialog with 3 custom buttons',
message: 'Click a button to continue.',
buttons: [
{ label: '1', value: 1 },
{ label: '2', value: 2 },
{ label: '3', value: 3 }]
};
function success(result) { console.log('Success with value: ' + result) }
function failure(reason) { console.log('Failure: ' + reason) }
dialog.create(options).then(success).catch(failure);
//...
//Add additional code
// Code Example 2
//Add additional code
...
dialog.create({
title: 'I am a Dialog with the default button',
message: 'Click a button to continue.'
});
//...
//Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4497804898.html