Description
Catalog Client Scripts do not work in Service Portal when the UI Type is set to Desktop.
Steps to Reproduce
In Service Catalog:
-
Navigate to a catalog item
For more information, see the product documentation topic Service catalog items
-
Right-click in the header and select Configure Catalog Client Script
-
Click New and create a new onload client script with the following script content:
function onLoad() { //Type appropriate comment here, and begin script below alert("test script catalog client script."); }
-
Set the UI type as Desktop
-
Save the catalog client script
-
Navigate to Service Portal and open the catalog item there
The URL resembles the following example:
https://<Instance_name>.service-now.com/sp?id=sc_cat_item&sys_id=51b5d9170a0a0b0c00b519afdeb51697
Workaround
This is expected behavior. In Service Portal, only client scripts with the UI Type of Both or Mobile are loaded.
Set the correct UI Type, ensure the catalog client script is compatible with mobile scripting APIs - then Service Portal will execute them properly.
Related Problem: PRB676011