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.

Open UI action in new tab

Reddy
Kilo Sage

Hello,

 

I have added a UI action button named "Create Change" on the catalog task table. When a user clicks on this button, it creates a change request and redirects to the new change request. However, I would like the new change request to open in a new tab.

 

I tried  window.open(url, '_blank'); & top.window.open(url, '_blank'); but it's not working.

 

 

window.open(url, '_blank');

 

 

Reddy_0-1703013885768.png

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Here is a perfect example in the thread. Put you record creation script in a script include and then use GlideAjax to call it from UI action and then use window.open or the method provided in the thread to open in a new tab.

 

https://www.servicenow.com/community/developer-forum/ui-action-to-open-newly-created-record-in-new-t...

 


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

3 REPLIES 3

SanjivMeher
Mega Patron
Mega Patron

To do so, your UI action needs to be Client UI action. window.open would only work in a client UI action.


Please mark this response as correct or helpful if it assisted you with your question.

@SanjivMeher Thank you for you response.

 

I tried it's not working. Can you help me with the script??

Here is a perfect example in the thread. Put you record creation script in a script include and then use GlideAjax to call it from UI action and then use window.open or the method provided in the thread to open in a new tab.

 

https://www.servicenow.com/community/developer-forum/ui-action-to-open-newly-created-record-in-new-t...

 


Please mark this response as correct or helpful if it assisted you with your question.