onChange script error: TypeError: ga.addParam is not a function function () { [native code] }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2025 06:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2025 07:19 PM
Hi @sairamr
It should be GlideAjax not GlideRecord.
Try the below script.
Please check below doc for more info on GlideAjax
https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var ga = new GlideAjax('ourInccallerDetails');
ga.addParam('sysparm_name','ourIncidentCallerValues');
ga.addParam('sysparm_ourcaller',g_form.getValue('u_caller'));
ga.getXMLAnswer(callback);
function callback(res) {
var callObj = JSON.parse(res);
g_form.setValue('u_email', callObj.mail) ;
g_form.setValue('u_location', callObj.loc) ;
g_form.setValue('u_department', callObj.dept) ;
}
}
Regards ,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 06:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 10:01 AM
@sairamr Instead of suing GlideRecord you need to use GlideAjax. Please consider updating your line 1 as follows.
var ga = new GlideAjax('ourInccallerDetails');
Also, please make sure to check the ourInccallerDetails script include, client callable.