Confirm Box on Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2017 06:43 AM
So I've tried every method I can think of within this onSubmit client script to have a confirm popup box work on the Service Portal. The problem seems to arise with the getReference variable. If I comment that out, it works fine. I've tried the method you see below and the call back method which is currently commented out.
The below code doesn't show the confirm box at all. The call back method will show the confirm box, but submits the request whether I click Ok or Cancel. I know the code made it into the ELSE portion of that IF Statement as well at the bottom as I had an alert there, but it still submits the request. I've also tried "return confirm" in the call back and it still ignores the response.
Has anyone used a confirm box and a reference field in the Service Portal? Again, it works perfectly fine if I don't try and get a name from a Reference field. If I just use getValue from string variables (or reference fields), then I have no issues getting it to work. The getReference seems to be the issue.
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2017 08:59 PM
As per I knew, we can't dot walk from getReference method like line #4. It is always a good practice to use callback function and in your callback function line #5 the element name is u_name and in line #4 and #12 mentioned as name. Please check the element name properly it may help
GlideForm (g form) - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2017 04:10 PM
Hi Steven,
Did you ever figure this one out? I'm having similar issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 01:27 PM
Peter,
I believe we got rid of the getReference in the script and ended up writing that data on the form (even in a hidden field would be fine) so that we could then use getValue, which works with the confirm box on the portal.
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven