Why location.url open window inside window

Alon Grod
Tera Expert

Hi,

Im trying to edit SC Catalog Item Req2RITM and if some conditions are met, redirect to the user using the client controller script directly to the RITM. For some reason,  $location.url(link) opened window inside a window.

WhatsApp Image 2023-11-27 at 13.16.16.jpeg

 

WhatsApp Image 2023-11-27 at 15.13.14.jpeg

4 REPLIES 4

Muhammad Khan
Mega Sage
Mega Sage

Hi Alon,

 

I have not tried, but maybe this will work for you.

$window.open(url, "_blank");

 

You can use different URL Target Types (_blank, _self, _top) as per you need.

 

@Muhammad Khan not working...it does not open anything

@Alon Grod 

 

can you try:

 

$window.location.href 

 

https://www.servicenow.com/community/developer-forum/redirect-url-in-widget-client-script-without-ha... 

 

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.

@Prince Arora hi its not working. This is what Im getting: (I supposed to be redirect to the RITM page and not to Request page in the SOW):

WhatsApp Image 2023-11-28 at 13.00.54.jpeg

 

WhatsApp Image 2023-11-28 at 13.02.33.jpeg