Click on "Ok" buttton not saving the form and closing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 04:02 PM
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
----------------
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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 11:31 PM
why to use UI page for this?
You can simply use confirm() box in onSubmit
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 11:36 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 04:41 AM
what did you use in the client script of that UI page ?
Thank you in advance