32 views

Symptoms


If a UI Policy or a Client Script is in a Scoped Application (such as Customer Service Application, etc.), they don't work as expected in Service Catalog.

Browser console error that indicates that this is the case:

TypeError: GlideRecord is not a constructor 
at onLoad_a79a71a7db5f5f003a7ed79b5e9619e0 (com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=e5e40c19db32b2403a7ed79b5e9619e9&sysparm_link_parent=9ff97a03db5f3e003a7ed79b5e961993&sysparm_catalog=e0d08b13c3330100c8b837659bba8fb4&sysparm_catalog_view=catalog_default:636) 
at com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=e5e40c19db32b2403a7ed79b5e9619e9&sysparm_link_parent=9ff97a03db5f3e003a7ed79b5e961993&sysparm_catalog=e0d08b13c3330100c8b837659bba8fb4&sysparm_catalog_view=catalog_default:688 
at VM806 js_includes_doctype.jsx?v=06-21-2018_1724&lp=Fri_Jun_22_09_58_01_PDT_2018&c=6_119:485 
at runBeforeRender (VM806 js_includes_doctype.jsx?v=06-21-2018_1724&lp=Fri_Jun_22_09_58_01_PDT_2018&c=6_119:402) 
at VM848 z_last_include.jsx?v=06-21-2018_1724:32 
at VM848 z_last_include.jsx?v=06-21-2018_1724:38 

Release


All releases

Cause


As per the documentation here, the reason they don't work as expected is because Client-side GlideRecord is not supported in scoped applications

Resolution


Follow the recommendation from the GlideRecord - Client production documentation, which suggests to create a script Include and use GlideAjax, or use the REST APIs.

Also review, GlideRecord - Scoped product documentation on how to use GlideRecord within a scope application. 

Additional Information


https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/GlideRecordClientSide/concept/c_GlideRecordClientSideAPI.html#c_GlideRecordClientSideAPI

https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/GlideRecord/concept/c_GlideRecordAPI.html#r_GlideRecord-GlideRecord_S

Article Information

Last Updated:2018-08-03 00:24:27
Published:2018-07-26