- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 08:40 AM
Hello,
I have a "Reject" UI Action that I need to display a pop-up for with a comment box. They need to write the reason for the rejection. After they click ok, the rejected comment populates a reason field on the form.
How can I set this up.
I am struggling to follow the example provided by SN Guru:
https://www.servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 08:51 AM
Hi,
You can pretty much duplicate the Cancel Change UI Action form the change_request table.
var rejectconfirmDialog;
function loadConfirmDialog() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
rejectconfirmDialog = new dialogClass("change_confirm_cancel", false, 648, 250);
rejectconfirmDialog.setTitle(new GwtMessage().getMessage("Reject Task")); //Modify title to display on popup
rejectconfirmDialog.render();
}
function moveToCancel(notes) {
//g_form.setValue("state",1) Possible to set the state here.
g_form.setValue("work_notes", notes); //Pass reason worknotes to a field
rejectconfirmDialog.destroy();
gsftSubmit(null, g_form.getFormElement(), "UI action name"); // Call UI action to run server script
}
if (typeof window == 'undefined')
setRedirect();
function setRedirect() {
current.update();
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 11:56 AM
Hi,
Is "7" a valid state value? Do you have any Business Rules that could be preventing the transition to this state value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2020 08:15 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2020 09:56 AM
Glad this solution worked for you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 06:46 AM
Can you help me on this please
https://www.servicenow.com/community/developer-forum/how-to-use-ui-page-in-onsubmit-client-script/m-...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 02:40 PM
Hi @Kieran Anson I have tried replicating the same for one of my requirement but when I provide the text in dialog box and click on "Ok" button it's not moving ahead and not redirecting me anywhere. Can you please help me?