- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2026 01:01 AM
Below onChange Client script is working in yokohoma but not in zurich, can someone please help me to understand on what is the issue?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue)
return;
var proceed = confirm("Please confirm");
if (!proceed) {
var ga = new GlideAjax('ScriptIncludeName');
ga.addParam('sysparm_name', 'Function');
ga.addParam('sysparm_abc', g_form.getValue('fieldname'));
ga.getXML(function() {
g_form.setValue('fieldname', '');
g_form.reload();
g_form.showFieldMsg(fieldname, 'cleared.', 'error');
});
}
}
@Ankur Bawiskar @Its_Sagnic @Matthew_13
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2026 10:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2026 01:34 AM
Hi @Sathwik1 ,
Can you try with the below code & see if it works?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue) return;
g_modal.confirm("Please confirm", function (confirmed) {
if (!confirmed) {
var ga = new GlideAjax('ScriptIncludeName');
ga.addParam('sysparm_name', 'Function');
ga.addParam('sysparm_abc', g_form.getValue('fieldname'));
ga.getXMLAnswer(function () {
g_form.setValue('fieldname', '');
g_form.showFieldMsg('fieldname', 'cleared.', 'error');
});
}
});
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2026 03:41 AM
Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2026 03:43 AM
Possible to share a snip of ur code
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2026 03:46 AM
If you are returning something from ur server side then we need to also include answer variable in ur function.
ga.getXMLAnswer(function(answer){
if(answer == 'somevalue'){
g_form.setValue('fieldname', '');
g_form.showFieldMsg('fieldname', 'cleared.', 'error');}})
