dialog.confirm(options)
Method Description |
Creates a Confirm dialog with OK and Cancel buttons. |
Returns |
Promise Object. To run a callback function when the OK button is pressed, pass a function to the then portion of the Promise object. The value of the pressed button, where OK is true and Cancel is false, is passed to the callback. |
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 confirmation dialog title. This value defaults to an empty string. |
2016.1 |
|
string |
optional |
The content of the confirmation 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
...
var options = {
title: "I am a Confirmation",
message: "Press OK or Cancel"
};
function success(result) {
console.log("Success with value " + result);
}
function failure(reason) {
console.log("Failure: " + reason);
}
dialog.confirm(options).then(success).catch(failure);
...
//Add additional code
The following screenshot shows an example of a Confirmation dialog:
