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 Action to Open UI Page in New Window not working

Nic Omaha
Tera Guru

Hello! 

I have a UI Page called u_print_move_list which I can hit preview on and works great. 

When I create a UI Action on a table to open up the UI Page nothing happens. I can see nothing different about this UI action from others that are working fine. Any ideas?

find_real_file.png

2 REPLIES 2

sachin_namjoshi
Kilo Patron
Kilo Patron

You can use below code in UI action to open UI page.

e.g . I have a ui page named testdriftinformation

 

here is the code below to get the ui action to load that page in the main window.

 

 

 

sendToNorChange();

 

 

 

function sendToNorChange()

 

{

 

 

 

//make the url to a new normal change

 

  var url = 'testdriftinformation.do';

 

 

 

 

 

//Redirecting the user to the new url

 

  action.setRedirectURL(url);

 

}

 

Regards,

Sachin

mike275
Mega Expert

Since the other reply didn't answer the question:

Instead of `window.open` you need to remember you are in an iframe and you should use:

 

`top.window.open`

`top` gives you a reference to the parent frame which has all the global JS Objects.

 

https://blog.mikeski.net/servicenow/