Unhandled exception in GlideAjax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:14 PM
Actually code is working fine i got java script browser console error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:26 PM
try this
function onChange(control, oldValue, newValue, isLoading) {
// Check if loading or newValue is empty
if (isLoading || newValue === '') {
return;
}
// Create GlideAjax instance
var ga = new GlideAjax('BISwCatDecomUtilAJAX');
ga.addParam('sysparm_name', 'multilinetextversion');
ga.addParam('sysparm_sys_id', newValue);
// Use getXML method instead of getXMLAnswer
ga.getXMLAnswer(function(answer){
alert("Suresh is " + answer);
// Use meaningful variable names
var multilineTextVersion = answer;
alert("The input is " + multilineTextVersion);
var parts = multilineTextVersion.split(/\),/);
if (parts.length <= 1) {
g_form.setDisplay('sw_cat_item_removed', true);
g_form.setReadOnly('sw_cat_item_removed', true);
} else {
// If there are more than one part
g_form.setDisplay('sw_cat_item_removed', false);
}
});
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:32 PM - edited 11-22-2023 07:39 PM
Still i got javascript console error
Is it requires to change any script include?
whenever I added else part
else { // If there are more than one part g_form.setDisplay('sw_cat_item_removed', false); }
i got javascript console error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 08:05 PM
doesn't relate to script include.
try deactivating this client script and see if the exception still comes
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 08:08 PM - edited 11-22-2023 08:11 PM
I have noticed because of this client script only got "Java script console error"
In Client script IF condition have only one "Software version"
While add else condition i got console error because in else condition has multiple "software versions" separated by comma
In client script can we change into JSON format