Confirmation Dialog with Yes and No buttons

 //Include 'N/ui/dialog' in your suitescript
let options = {
                title: 'Dialog Box title',
                message: 'Are you sure you want to continue?',
                buttons: [
                    { label: 'Yes', value: true },
                    { label: 'No', value: false }

                ]
            };
            dialog.create(options).then(success).catch(failure);
            function success(result) {

                if (result == true) {
                    // User clicked "yes," logic that should be excuted.
                
         }
                else {
                  //Write the code to be exceuted when user clicks No
                }
            }
            function failure(reason) {

                console.log('User terminated request', reason);
                return;
            }
            

Leave a comment

Your email address will not be published. Required fields are marked *