Display Confirmation Dialog

Display Confirmation Dialog - kintone.showConfirmDialog(config)

Display a confirmation dialog that prompts the user for confirmation and retrieves their choice.

Function

Desktop

kintone.showConfirmDialog(config)

Parameters

Parameter Type Required Description
config Object Yes The dialog configuration.
config.title String Optional The title string.
If ignored, it will not be displayed.
config.body String Optional The dialog body text.
\n, \r, \r\n are interpreted as line breaks.
If ignored, it will not be displayed.
config.showOkButton Boolean Optional The visibility of the OK button.
  • true: Display the OK button.
  • false: Do not display the OK button.
If ignored, it will be displayed.
config.okButtonText String Optional The text to display on the OK button.
If ignored, "OK" will be displayed according to the logged-in user's language.
config.showCancelButton Boolean Optional The visibility of the Cancel button.
  • true: Display the Cancel button.
  • false: Do not display the Cancel button.
If ignored, it will not be displayed.
config.cancelButtonText String Optional The text to display on the Cancel button.
If ignored, "Cancel" will be displayed according to the logged-in user's language.
config.showCloseButton Boolean Optional The visibility of the Close button.
  • true: Display the Close button.
  • false: Do not display the Close button.
If ignored, it will not be displayed.
If not displayed, the function to close the dialog with the Esc key will also be disabled.

Returns

A Promise object.
The following values can be retrieved when the Promise object is fulfilled:

Property Type Description
result String The action selected by the user.
  • OK: The user clicked the OK button.
  • CANCEL: The user clicked the Cancel button.
  • CLOSE: The user clicked the Close button, or pressed the Esc key.

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
// Basic confirmation dialog
kintone.showConfirmDialog({
  title: 'Confirmation',
  body: 'Do you want to delete this record?',
  showOkButton: true,
  showCancelButton: true,
  okButtonText: 'Delete',
  cancelButtonText: 'Cancel',
  showCloseButton: true
}).then((result) => {
  if (result === 'OK') {
    console.log('Executing deletion');
  } else {
    console.log('Deletion cancelled');
  }
});

Available Pages

Desktop

However, it cannot be used on the following pages:

  • Search results
  • Marketplace
  • Plug-in settings page