There is a JavaScript error in your browser console - Unhandled exception in GlideAjax

NG8
Giga Contributor

Getting the error on the Catalog side. This is the only Catalog script for that catalog item. 

 

function onChange(control, oldValue, newValue, isLoading) {
// if (isLoading || newValue == '') {
// return true;
// }
// var id_change=g_form.getReference('Submitted_For_Name',getUserID);
// function getUserID(id)
// {
// g_form.setValue('requested_for_user_id',id.user_name);
// }

var ga = new GlideAjax('user_details');
ga.addParam('sysparm_name','userFieldValues');
ga.addParam('sysparm_user',g_form.getValue('submitted_for_name'));
ga.getXML(simple);

function simple(response){
var answer = response.responseXML.documentElement.getAttribute('answer');
var a = answer.split(',');
g_form.setValue('submitted_for_user_id',a[2]);
return;

}
}

1 ACCEPTED SOLUTION

NG8
Giga Contributor

So seems like having "Applies on Requested Items" and "Applies on catalog Tasks" checked will give you this error. After i unchecked it, the error was gone. Really odd but it worked. 

Thank you all for your assistance with this. I appreciate it. 

I am marking this as correct answer for others to see. 

 

 

find_real_file.png

View solution in original post

24 REPLIES 24

Tried to paste SI code and getting an error. see screenshot below 

 

find_real_file.png

Has a missing +

use this for line 14

retVal = gr.email +','+ gr.phone+','+gr.user_name+','+ gr.title.getDisplayValue() +','+gr.location.getDisplayValue()+','+ gr.department.getDisplayValue();

NG8
Giga Contributor

Just tried that and still getting the same error on the Catalog side. "There is a JavaScript error in your browser console"

 

When i go into developer tools in Chrome this is what is shown. 

find_real_file.png

can you put this line in the client side code

console.log('got answer = ' + answer.toString());

 

also comment out in simple function.

//return;

 

Try this

 retVal = gr.email+','+gr.phone+','+gr.user_name+','+ gr.title.getDisplayValue() +','+gr.location.getDisplayValue()+','+ gr.department.getDisplayValue();