Scoped Application: How to open URLs in a new tab/window?

jivanjotkaur
ServiceNow Employee
ServiceNow Employee

I am trying to open a URL in a new tab/window in the client script of a UI action. Due to it being a scoped application, window.open(url) does not work. What alternative is there for window.open in a scoped app?

1 ACCEPTED SOLUTION

jivanjotkaur
ServiceNow Employee
ServiceNow Employee

Found that there is an API called g_navigation through which we can perform some DOm related tasks, e.g. reloading the page, opening a popup etc. I couldnt find the documentation for this API though.



For my requirement, i used the following code in my client script:



g_navigation.openPopup(url);


View solution in original post

7 REPLIES 7

jivanjotkaur
ServiceNow Employee
ServiceNow Employee

Found that there is an API called g_navigation through which we can perform some DOm related tasks, e.g. reloading the page, opening a popup etc. I couldnt find the documentation for this API though.



For my requirement, i used the following code in my client script:



g_navigation.openPopup(url);


Just in case anyone finds this thread (it's one of only a couple that show up via searching), documentation for g_navigation is available on the Developer community (developer.servicenow.com) under the Helsinki release and "GlideNavigationV3".


Hey Jivanjot Kaur,

This really helped for what I was looking to achieve, as Erik mentioned, documentation for g_naviagtion is available on developer.servicenow.com>API>Client>GlideNavigationV3

Thanks,

Pratik