Client Scripts / UI Policies in Scoped Application do not work as expected in Service Catalog



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 ( 
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 


All releases


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


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