How to make "Create Request" in Universal Request button to open in Portal view

Luiz Lucena
Mega Sage

Hello everyone,

We are starting with Universal Request and the button Create Request opens in Service Catalog in the ITIL view, we would like to make it open in our Service Catalog page in the portal view.

To accomplish that, I've modified the URL variable in the code below, but the page is being opened "within" agent view.
We would like to open in a new window without the agent view header.

Here is the code:

var url;
var activeCatalogsCount = sn_sc.Catalog.getCatalogCount();
if (activeCatalogsCount === 1) {
    //url = "catalog_home.do?sysparm_view=catalog_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
	url = "sp?id=sc_home";
}
else {
    //url = "catalogs_home.do?sysparm_view=catalogs_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
	url = "sp?id=sc_home";
}


action.setRedirectURL(url);

 
It's being opened like this:
Screenshot 2022-10-14 at 11.43.23 AM.png

 

the URL being opened is ending with this:
now/nav/ui/classic/params/target/sp%3Fid%3Dsc_home

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Hi, @Luiz Lucena ,

Here is a UI Action example that works.

 

niklaspeterson_0-1665815224481.png

Regards,

Niklas

View solution in original post

4 REPLIES 4

Niklas Peterson
Mega Sage
Mega Sage

Hi @Luiz Lucena ,

 

To do that you need to run it client side. 

g_navigation.openPopup(url);

should work.

Regards,

Niklas

Hi @Niklas Peterson , 

 

That didn't work.

 

I've added the line "g_navigation.openPopup(url);" right after where I'm passing the url. 
Also, when I check the box "Client" it didn't work at all.

Hi, @Luiz Lucena ,

Here is a UI Action example that works.

 

niklaspeterson_0-1665815224481.png

Regards,

Niklas

Thanks, @Niklas Peterson , that worked but for us we had to leave the "Client" checkbox unchecked.