Catalog Client Scripts - Unable to use restricted scripting for DOM manipulation

DoraTheExplorer
Tera Contributor

For some background information on what I am trying to achieve, I have a catalog item page in the employee center that I would like to target the DOM to use restricted scripting (cannot achieve through g_form methods). In doing so, I am using the Catalog Client Script service to target the specific UI page.

 

Using the suggested solutions of disabling 'glide.script.block.client.globals' in the system properties (scoped app) and disabling isolate script, I was still unable to get Catalog Client Scripts to use restricted scripting. (Javascript/jQuery calls: document, windows, $, etc. )

 

The odd occurrence is that the suggested solutions take effect on Client Scripts but not Catalog Client Scripts. Client Scripts may be out of the equation, as I could not target the catalog item on the employee center via Client Scripts tables.

 

Any suggestions or thoughts would be much appreciated. Thanks!

 

Catalog Client Scripts:

catalog-client-script-config.PNG

 

System Property Config & Errors received:

sys-prop-config.png

4 REPLIES 4

Community Alums
Not applicable

Hi @DoraTheExplorer ,

 

You cannot use document method inside Catalog Client script per this article: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0719250

 

If you want to disable that submit button, do it inside its Widget .

Hi @Community Alums,

 

This solution looks promising. Will look into this, thank you~ 

Anirudh Pathak
Mega Sage

Hi,

Why do you want to disable the "submit" button on a catalog item?

In case, if that catalog item is just for information purpose create a Content Item instead of Catalog item.

Check this link on how to create a Content Item - 

https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/service-catalog-man...

Hi @Anirudh Pathak

I want to disable the submit button when a guided tour is in session (so no accidental ticket is submitted), but keep the submit button enabled for live submissions. Overall, it would be nice to know if I can manipulate the DOM for future use in the Service Portal.