UI Page Processing script redirect to another page issue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2017 08:41 PM
Hi I have a UI Page which is called via GlideDialogWindow functionality.
In my processing script i have a code that would redirect to a specific page.
The issue is when I run this specific script:
var instanceName = gs.getProperty('instance_name');
var urlOnStack = "https://"+instanceName+".service-now.com/test/test.do?sysparm_document_key=test," +parentSysID;
response.sendRedirect(urlOnStacks);
The UI Page that is called via glidewindow just got wider or it got redirected to the UI Page I built but when I checked the URL its the correct URL.
But when I run this script (it working fine but It will just redirect to the same page, what I want is to redirect to another page):
var urlOnStacks = GlideSession.get().getStack().bottom();
response.sendRedirect(urlOnStacks);
Is there another way to redirect it?
Thanks,
Tadz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2017 09:21 PM
if you use window.open("url","_blank"), it will open UI page in new window.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2017 09:28 PM
Hello Cris,
Use window.open ('/class_test.do');// class_test.do is the destination redirect page.
ServiceNow Commnunity MVP -2018 class.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2017 10:49 PM
Hi,
I tried the window.open('/class_test.do').
Its working fine.
is there another way that it will not open a new tab?
Thanks,
Tadz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2017 11:00 PM
Refer the below thread may helpful to you.
Open a new tab within UI Action
How to open a new window using UI action javascript after clicking a button?
Open in new tab no longer works
ServiceNow Commnunity MVP -2018 class.