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-09-2017 01:41 AM
Nope, I mean window.open('/class_test.do','_self'); is still reopening new tab even though I'm using chrome.
Thats why i used top.window.location = '/class_test.do';
But it's not working on IE 11 on my end.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 01:55 AM
Hi Cris,
Try with GlideURL
function showSite() {
var instanceName = gs.getProperty('instance_name');
var urlOnStack = "https://"+instanceName+".service-now.com/test/test.do?sysparm_document_key=test," +parentSysID;
var url = new GlideURL(urlOnStack);
var w = getTopWindow();
var newWindow = w.open(url.getURL(), "_blank");
newWindow.focus();
return false;
}
Hope this helps.
Regards
Ujjawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 01:35 PM
Old thread, but this might save someone some time if looking to accomplish a redirect properly on the server side.
After referencing other OOB UI Pages with Processing Scripts that redirect after submission, it looks like this works:
response.sendRedirect(projectTable + ".do?sys_id=" + project_id);