- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 09:54 AM
The current problem is: I want to set the list collector value with user list I get back from GlideAjax response in my onChange catalog client script. The `userList` I got back and display on the form is actually the same as my hardcoded list for user sys ids. But when I set the hardcoded value to the users field of the form, it only appears 2 users on the right of the slushbucket. What is going on and how do I resolve this problem?
Below are the code:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 11:03 AM
If the property doesn't exist the results are limited to 100. Create a property with that name and set it to 200, or 500, or whatever. Updating the filter, either via reference qualifier or a script will limit the number of records on the left, thereby ensuring that the intended records are present. In this case, it seems like it would be best to use the same string of sys_ids returned by the GlideAjax, then you would precede it with 'sys_idIN' before using it to update the filter, then lastly update the variable value:
function callback(resp) {
var userList = resp;
var varName = list_collector_variable_name;
var filterString = 'sys_idIN' + resp;
try{
var myListCollector = g_list.get(varName);
myListCollector.reset();
myListCollector.setQuery(filterString);
}
//Revert to Service Catalog method
catch(e){
window[varName + 'g_filter'].reset();
window[varName + 'g_filter'].setQuery(filterString);
window[varName + 'acRequest'](null);
}
g_form.setValue('users', userList);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 11:03 AM
If the property doesn't exist the results are limited to 100. Create a property with that name and set it to 200, or 500, or whatever. Updating the filter, either via reference qualifier or a script will limit the number of records on the left, thereby ensuring that the intended records are present. In this case, it seems like it would be best to use the same string of sys_ids returned by the GlideAjax, then you would precede it with 'sys_idIN' before using it to update the filter, then lastly update the variable value:
function callback(resp) {
var userList = resp;
var varName = list_collector_variable_name;
var filterString = 'sys_idIN' + resp;
try{
var myListCollector = g_list.get(varName);
myListCollector.reset();
myListCollector.setQuery(filterString);
}
//Revert to Service Catalog method
catch(e){
window[varName + 'g_filter'].reset();
window[varName + 'g_filter'].setQuery(filterString);
window[varName + 'acRequest'](null);
}
g_form.setValue('users', userList);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 01:08 PM
Got it, finally it works and thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 03:31 PM
You are welcome!