- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 06:37 AM
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;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:53 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:18 AM
So the parameter you are sending is empty
ga.addParam('sysparm_user',g_form.getValue('submitted_for_name'));
Can you check the name of the form field. Any casing issue?
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:36 AM
Everything looks the same. See below. That field will be empty until a user enters "Submitted for name" value. It is "On change" script.
When i change it to "Requested by" which loads automatically because default value is set to "javascript:gs.getUserID();" i do get a value in "sending user="
However, this time after clicking OK, i do not get get JavaScript error. Weird
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:42 AM
So when i set default value for "Submitted for" variable "javascript:gs.getUserID();" i do not get the error message anymore. But this field should not populate to whoever is filling out the form, only "Requested by" should do that.
"Submitted for" field is there if Requested by" and "Submitted for" are different. Ex. If manager is requesting access for their employee.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 10:53 AM
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.