New client-scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype and the window object are likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To dis

John Vo1
Tera Guru

I'm getting this error in my Dev instance and it's on London.  I've set the glide.script.block.client.globals to false and it's still not working.  My Prod instance is on Kingston and it works correctly.  We have to upgrade Prod soon and would like someone to take a look at my code and see if they can help me update it.

 

Here is my code.

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;

 

var ga = new GlideAjax('pattCiCheck');

 

ga.addParam('sysparm_name', 'getCiSupportGroup');
ga.addParam('sysparm_ci', newValue);
//alert(g_form.getValue('cmdb_ci'));
//ga.addParam('sysparm_ag', g_form.getValue('assignment_group'));
//alert(g_form.getValue('assignment_group'));
ga.getXML(doAlert); // Always try to use asynchronous (getXML) calls rather than synchronous (getXMLWait)
}

 

// Callback function to process the response returned from the server
function doAlert(response) {

 

var answer = response.responseXML.documentElement.getAttribute("answer");

 

var answers = answer.split(',');

 

if (answer != '')
g_form.setValue("variables.software_owner", answers[0]);
g_form.setValue("license_type", answers[1]); // Change accordingly
g_form.setValue("ad_group_name", answers[2]);
}

6 REPLIES 6

Michael Fry1
Kilo Patron

Did you add the Isolate script (field) checkbox to the client script form and uncheck it? I'm assuming you wrote this script in your London version.

No it was written for Kingston version.  When we upgraded to London our Dev instance stop working for this catalog item.

AbhishekGardade
Giga Sage

Hello John,

Check out this blog about your query:

Isolate Script in London

1.Uncheck Isolated SCript field: First configure form layout and add field

find_real_file.png

2. Modfied Code

g_form.setValue("software_owner", answers[0]);
g_form.setValue("license_type", answers[1]); // Change accordingly
g_form.setValue("ad_group_name", answers[2]);

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Sadaf Baig1
Tera Contributor

Hi,

I am getting same error. I am working on ServiceNow New York version. I added property and uncheck "Isolate script" field value. but still client script is not working. please suggest me solution.