Display Confirmation Messages when Deleting Records
Overview
This article introduces how to display confirmation messages with SweetAlert2 when deleting records in Kintone. SweetAlert2 can be used to display text, images, timers, and confirmation notices within stylish pop-ups.
Sample Images
When saving a record, a pop-up is displayed asking to confirm the action.
When deleting a record, a pop-up is displayed again to confirm the action.
Prepare the App
Create the Form
Create an App that includes any types of fields. Save the form when finished.
Set the Library
This sample uses SweetAlert2 v7.24.4. Set the following URLs into the App's JavaScript and CSS Customization settings .
- https://js.kintone.com/sweetalert2/v7.24.4/sweetalert2.min.js
- https://js.kintone.com/sweetalert2/v7.24.4/sweetalert2.min.css
Sample Codes
Type the following codes into text editors and save them as JavaScript files. Upload them the App's JavaScript and CSS Customization settings .
The following sample, save.js
displays the pop-up after the user clicks on the Save button in the record.
|
|
The following sample, recover_delete.js
displays the pop-up after the user clicks on the Delete button in the record.
|
|
The JavaScript and CSS Customization page should look like the following:
After saving the settings, update the App. Try creating or deleting a record. The SweetAlert2 pop-up should now ask for confirmation before proceeding the action.