UI Action/Client Side/Workspace Client Script

Jonathan102
Tera Guru

I am using the following script in a UI Action that is client side to open a specified URL in a new tab which works.+

 

function openWindow(){
top.window.open('MY URL','_blank') ;
}
 
I now need to add logic to the workspace client script that will do the same BUT open the URL in a new workspace tab versus opening in a new window tab.
 
I appreciate any/all help!
 
Thanks,
Jonathan 
 
 
2 REPLIES 2

Jon Hogland
Tera Guru

Hi! If I'm understanding your requirement, I believe you're looking for the GlideAgentWorkspace API. The particular function that performs what you're looking for is: g_aw.openRecord()


Here's the documentation for the api along with function examples: https://developer.servicenow.com/dev.do#!/reference/api/xanadu/client/GlideAgentWorkspaceAPI


Alternatively, this thread might have better info for you: https://www.servicenow.com/community/csm-forum/agent-workspace-how-to-open-a-ui-action-in-a-sub-tab-...



If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!

Ankur Bawiskar
Tera Patron
Tera Patron

@Jonathan102 

Did you check any OOB UI action which does this?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader