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.

How to open url into new tab in agent workspace

Poorna7
Tera Expert

I have written below code in ui action client script , it is working fine if but it is opening a link in new window outside of agent workspace but I want to open it in the new tab with n agent workspace only. Could someone help me how should I achieve this.

function onClick(g_form) {
var url = 'sp?id=sc_cat_item&sys_id=14287122db109050665dd855ca961914&parent=' + g_form.getUniqueValue();
open(url);
}

 

1 ACCEPTED SOLUTION

My bad I thought you want to open new browser tab. 

To open inside the workspace tab, have you checked g_service_catalog.openCatalogItem()

 

eg: you can refer ootb UI Action, "Create Request" 

Reference:

 

https://docs.servicenow.com/bundle/quebec-it-service-management/page/product/service-catalog-managem...

 

View solution in original post

28 REPLIES 28

Narsing1
Mega Sage

Hi,

Try with this

g_navigation.openPopup(<url>);

Thanks,

Narsing

Nopes didn't work. UI Action is in HR Scope.

Harsh Vardhan
Giga Patron

try 

function onClick(g_form) {
var url = 'sp?id=sc_cat_item&sys_id=14287122db109050665dd855ca961914&parent=' + g_form.getUniqueValue();
this.open(url,'_blank');
}

 

nopes didn't work.