- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 03:56 AM
Hello,
i know the following article about round trips of the serviceNow system
https://community.servicenow.com/community?id=community_blog&sys_id=b23deae5dbd0dbc01dcaf3231f961992&view_source=searchResult
but still i cannot figure out why the system is spamming
"*** WARNING *** GlideAjax.getXMLWait - synchronous function - processor: AjaxClientHelper"
when i add options to a choice field on the incident form dynamically. The system is sending the following header each time an option is added (g_form.addOption()) to my custom choice list:
sysparm_processor: AjaxClientHelper
sysparm_scope: global
sysparm_want_session_messages: true
sysparm_name: getDisplay
sysparm_table: sys_user_group
sysparm_value:
sysparm_synch: true
ni.nolog.x_referer: ignore
x_referer: incident.do
The options are retrieved by an asynchronous ajax call which works fine. As soon as the client script starts to loop over the retrieved options and add them to the choice field, the system starts spaming the synchrounous ajax calls ...
Does anyone know why the system behaves this way? The addOption function does not have a DisplayValue does it?
if (options.length > 0) {
g_form.addOption('myChoiceField', '', '-- None --');
for (var i = 0; i < options.length; i++) {
if(options[i] != null){
g_form.addOption('myChoiceField', options[i], options[i]);
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 05:38 AM
Modify it like this
function onChangeMyChoiceField() {
if(newValue == "" || isLoading){
return;
}else if(oldValue != newValue){
//Your changes here
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 05:38 AM
Modify it like this
function onChangeMyChoiceField() {
if(newValue == "" || isLoading){
return;
}else if(oldValue != newValue){
//Your changes here
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 06:41 AM
Thanks, now the onChange function does not get triggert by addOption(). This is a cascading problem -.-