How to create a user input pop up window?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2017 05:07 PM
Hi All,
I have a requirement when a HRcase reopened, user have to enter reason for reopening the case. When user click on "Reopen case" UI action it should pop up a window for user to enter reason for reopening (should have an "ok" or "cancel" button in that window) and when user click ok it should check if the input box is empty and add that comment into Comment field , change the case state to work in progress and save. if user click cancel then it should return to current page. Comment shouldn't be empty.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 01:00 AM
Hey Sara,
Refer this that will help you -
GlideDialogWindow: Advanced Popups Using UI Pages - ServiceNow Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2017 10:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2017 10:54 PM
Hi Sarasaamani,
you could use prompt box given by javascript itself as suggested by me in earlier comment which contains long input text field.
screenshot below
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2017 11:50 PM
Hi Ankur,
its showing the pop up box but its not changing the state or updating reason in the description field after i click ok.
Is there anything wrong with my script?
function commentsDialog() {
var reason = prompt("Please enter reason for reopening this case");
if (reason != null){
new StateFlow().processFlow(current, 'c77bfec04f682200143327201310c7d7', 'manual');
current.state = '18';
g_form.setValue("decription", reason);
current.update();
action.setRedirectURL(current);
}
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2017 12:02 AM
Hi Sarasaamani,
You are using prompt box which is client side and the below code is server side so it won't work.
You get the value from prompt box, send the reason and record sys id to script include and update the record in that script.
when you get the response from GlideAjax stay on the form. no need to use redirect etc.
Try using below or else follow above approach
g_form.setValue('reason',reason);
g_form.save()
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader