- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 04:34 AM
Hi,
I am facing a issue in GlideAJAX and ScriptIncludes. Kindly help.
GlideAJAX
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.addInfoMessage("before");
if (newValue == "") {
g_form.setValue('current_primary_approver', "");
g_form.setValue('share_type', "");
g_form.setValue('protocol_type', "");
} else {
g_form.addInfoMessage('after');
var ga = new GlideAjax('populate_modify_network');
ga.addParam('sysparm_name', 'get_modify');
ga.addParam('sysparm_share_path', newValue);
ga.getXML(callBackFunction);
g_form.addInfoMessage('entering function');
function callBackFunction(response) {
g_form.addInfoMessage('line 1');
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.addInfoMessage('line 2');
var op = JSON.parse(answer);
g_form.addInfoMessage('line 3');
g_form.setValue('current_primary_approver', op.approver);
g_form.addInfoMessage('line 4');
g_form.setValue('share_type', op.type);
g_form.addInfoMessage('line 5');
g_form.setValue('protocol_type', op.protocol);
g_form.addInfoMessage('line 6');
}
}
}
ScriptIncludes
var populate_modify_Network = Class.create();
populate_modify_Network.prototype = Object.extendsObject(AbstractAjaxProcessor, {
get_modify : function()
{
var path = this.getParameter('sysparm_share_path');
var values = {};
var gr = new GlideRecord('u_cmdb_ci_file_share');
gr.addQuery('sys_id',path);
gr.query();
if(gr.next())
{
values.approver = gr.managed_by.toString();
values.type = gr.u_type.getDisplayValue();
values.protocol = gr.u_protocol.getDisplayValue();
}
return JSON.stringify(values);
},
type: 'populate_modify_Network'
});
Error
I am getting until 'entering function'.
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 04:45 AM - edited 02-19-2025 04:46 AM
Hello, you have typo in Catalog Client Script:
var ga = new GlideAjax('populate_modify_network');
Parameter is case sensitive, it should contain capital letter N:
var ga = new GlideAjax('populate_modify_Network');
If my answer helped you, please mark it as correct and helpful, thank you 👍
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 04:45 AM - edited 02-19-2025 04:46 AM
Hello, you have typo in Catalog Client Script:
var ga = new GlideAjax('populate_modify_network');
Parameter is case sensitive, it should contain capital letter N:
var ga = new GlideAjax('populate_modify_Network');
If my answer helped you, please mark it as correct and helpful, thank you 👍
Martin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 04:54 AM
Hi,
You should be able to avoid a GlideAjax call and client script altogether.
You can use the auto populate option on your 3 variables, and set the dependency to the share_path field. You can then choose the value to populate via the reference field. This config is done directly on each variable record