How to enable Isolate Script in Case Form?

Syed Asad
Kilo Contributor

Hi,
I am new to the ServiceNow community and I am facing issues in accessing DOM Objects like getElementById() in Client Script. I have imported an application and I am getting this message :

New client scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype, and the window object is likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To disable this feature for all new globally-scoped client-side scripts set the system property "glide.script.block.client.globals" to false.


I referred to this Article https://community.servicenow.com/community?id=community_blog&sys_id=c5c46364dbba6b007d3e02d5ca9619cb Which says I need to Uncheck Isolate Script Checkbox. But Isolate Script field is not visible in the Form Design configuration. 

Please help me understand how I can access DOM objects in Client Script in a custom application and where I will get this Isolate script in case form? Any help will be much appreciated.

Please refer to the Screenshots.

Thanks!

6 REPLIES 6

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi Syed,

You can open the list view of client script and set true from there.

find_real_file.png

Hope it helps.

Regards,

Ujjawal

Hi Ujjawal,

Thanks, for the reply. I opened the list view of the Client script but there also can't see the Isolate Script option. 

Actually, I am using DOM objects like getElementById in one of my client scripts but somehow I am unable to fetch elements value from the DOM. I searched on google and got an Article that explains that I need to uncheck the Isolate Script field. But I can't see the Isolate Script option anywhere in my Instance.

Thanks!

You can personalize the list and then you can add isolate field

find_real_file.png

find_real_file.png

 

Hi,

If I am able to answer your question then please mark my answer correct and helpful. So that it can be helpful for future readers for same query.