dialog.alert(options)
Method Description |
Creates an Alert dialog with an OK button. |
Returns |
Promise Object. To run a callback function when the OK button is clicked, pass a function to the then portion of the Promise object. When the OK button is clicked, true is passed to the callback. You do not have to use the Promise object unless there is an action you want performed after the user clicks the OK button. |
Supported Script Types |
Client scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2016.1 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
optional |
The alert dialog title. This value defaults to an empty string. |
2016.1 |
|
string |
optional |
The content of the alert dialog. This value defaults to an empty string. |
2016.1 |
Syntax
The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/ui/dialog Module Script Samples.
//Add additional code
...
function success(result) { console.log('Success with value: ' + result) }
function failure(reason) { console.log('Failure: ' + reason) }
dialog.alert({
title: 'I am an Alert',
message: 'Click OK to continue.'
}).then(success).catch(failure);
...
//Add additional code
The following screenshot shows an example of an Alert dialog:
