Description
Catalog UI policies with scripts on scoped application catalog items do not work on Service Portal.
Steps to Reproduce
-
Install the Human Resources Scoped App: Service Portal [ com.sn_hr_service_portal] plugin with demo data.
-
Select Human Resource: Service Portal from Application picker.
-
Go to the Disciplinary Issue Inquiry record producer (http://instance-name.service-now.com/nav_to.do?uri=sc_cat_item_producer.do?sys_id=03c78de49f331200d9011977677fcfa4).
-
Create new Catalog UI Policy with the following values:
- Run scripts in UI Type: All
- Run scripts: true
-
Navigate to http://<instance-name>.service-now.com/hrportal.
-
Select the Disciplinary Issue Inquiry catalog item (http://instance-name.service-now.com/hrportal?id=hri_sc_cat_item&sys_id=03c78de49f331200d9011977677fcfa4).
-
Check for console errors.
The following errors appear:
(g_env) [UI:SCRIPT_TRUE] Could not load UIPolicy script for policy "Qualifying Period" (g_env) [UI:SCRIPT_FALSE] Could not load UIPolicy script for policy "Qualifying Period" UI policy script error: TypeError: Cannot read property 'execute' of undefined
Workaround
This issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix.
On instances that can not be upgraded yet, it is possible to set isolate script to false to resolve this issue for globally scoped UI Policies. If the custom function is defined within the onCondition function block, the UI Policy is executed. For example:
Related Problem: PRB1078186