Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Page Processing script redirect to another page issue

Tadz
Kilo Sage

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

12 REPLIES 12

sachin_namjoshi
Kilo Patron
Kilo Patron

if you use window.open("url","_blank"), it will open UI page in new window.



Regards,


Sachin


Karthik Reddy T
Kilo Sage

Hello Cris,



Use window.open ('/class_test.do');// class_test.do is the destination redirect page.


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Tadz
Kilo Sage

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


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


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.