Onclick of an UI action it should redirect to a Catalog item in ESC Portal which is not working

NandithaBM
Tera Contributor

Hi everyone, please help me with your solutions for the issue below:

 

I have a custom UI action built on the Change request table, which when clicked by end-users should take them to a Catalog item in the ESC Portal. The UI action has the Client checkbox enabled and in the script section we are retrieving the sys_id of the catalog item from a display business rule, additionally the url is built like "esc?id=sc_cat_item&sys_id=CatalogID".  The methods responsible for re-direction i.e. window.location.href = url/ window.open(url, "_blank") were used, but it seems to behave the same way without landing on the ESC Portal.

1 ACCEPTED SOLUTION

Shaik Dimple
Kilo Sage

Hi @NandithaBM,

 

I have implemented a similar requirement using a Client UI Action.

Instead of "window.location.href / window.open()", you can try "g_navigation.open()" with the portal URL:

function openCatalogItem() {
    var catalogId = 'YOUR_CATALOG_ITEM_SYS_ID';
    var url = '/esc?id=sc_cat_item&sys_id=' + catalogId;

    g_navigation.open(url, '_blank');
}

Make sure the Catalog Item is available in the ESC portal and that the URL is correct. I would also first test the generated URL directly in the browser.

 

If you need to pass values from the Change Request to the Catalog Item, you can append them as URL parameters similar to "sysparm_variables".

 

If this solution helps, please mark it as Helpful and Accept it as the Solution.

 

Regards

Dimple Shaik

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@NandithaBM 

share your complete script screenshots along with config screeshots

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

Shaik Dimple
Kilo Sage

Hi @NandithaBM,

 

I have implemented a similar requirement using a Client UI Action.

Instead of "window.location.href / window.open()", you can try "g_navigation.open()" with the portal URL:

function openCatalogItem() {
    var catalogId = 'YOUR_CATALOG_ITEM_SYS_ID';
    var url = '/esc?id=sc_cat_item&sys_id=' + catalogId;

    g_navigation.open(url, '_blank');
}

Make sure the Catalog Item is available in the ESC portal and that the URL is correct. I would also first test the generated URL directly in the browser.

 

If you need to pass values from the Change Request to the Catalog Item, you can append them as URL parameters similar to "sysparm_variables".

 

If this solution helps, please mark it as Helpful and Accept it as the Solution.

 

Regards

Dimple Shaik

Hey hi @Shaik Dimple your suggestion worked. Thanks a lot!

You're welcome, @NandithaBM. Glad it worked. 😊