Click on "Ok" buttton not saving the form and closing

janindiadoc_1
Tera Expert

Hi All,

 

I have a simple requirement to show a popup message when one of the fields in the backend request for updates to "Approved" and hit save. I created a UI page and an onSubmit client script for this. The code for both are pasted as below.

 

Issue : The popup window is coming fine with the messages while clicking "Save" button. But while clicking on "Ok" the popup window is closed but nothing happening. The request form is not getting saved with the updated values.

Not sure what is wrong with the below code.

UI Page Code

----------------

janindiadoc_1_0-1711321054030.png

OnSubmit Client script

---------------------------

function onSubmit() {
var message = "Do you want to submit the record? Press OK to save, Cancel to abort!";
var title = "Request Submit Confirmation Message";
var glideModal = new GlideModal("info_message_popup", true);
glideModal.setTitle(title);
glideModal.setPreference("sysparm_message", message);
glideModal.render();
return false;
}

Thank you
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@janindiadoc_1 

why to use UI page for this?

You can simply use confirm() box in onSubmit

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Business don't want the normal confirm alert box, want a custom popup.

Anyway, it got solved as I did something similar to the OOB from the glide_confirm_modal_basic ui page and it woked.

Thank you,

Anjana

what did you use in the client script of that UI page ? 
Thank you in advance