how to use windows.open in servicenow

GaneshBendkule
Tera Contributor

how to use windows.open in servicenow

3 REPLIES 3

Marcos Kassak
Kilo Sage
Kilo Sage

If you are referring to:

 

window.open(URL, name, specs, replace);  

 

from Javascript, you must be in a Client Script to use it.

 

Do you mind sharing your requirements so I can assist you further?

I'm currently grappling with a challenge related to automating the retrieval of OAuth tokens within a web environment. The situation involves needing an `oauth_token` via a UI action that triggers the opening of a specific link in the browser. This link looks something like:

 

https://dev182409.service-now.com/oauth_initiator.do?oauth_requestor_context=${oauth_requestor_conte...

 

The catch here is that the process relies on the `windows.open()` function, which can only execute on the client side. Our goal is to acquire the OAuth token for an access token, especially when the current token has expired.

 

I'm seeking guidance on how to achieve this automation and the underlying logic required. Any insights, strategies, or tools that could assist in handling this scenario would be greatly appreciated!

 

Community Alums
Not applicable

Hello @GaneshBendkule,

g_navigation.openPopup(url); should work.

Thanks!