- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 07:05 AM
Hello guys,
I tried to create a dynamic filter that retrieves users for a specific group. It works perfectly when I apply it as a Reference Qualifier on a variable in a Catalog Item, but when I try to apply it as a filter on "Assigned to" in the "Incident" table the Filter shows (empty).
The getRITUsers function is defined in an Include Script which is Client Callable and accessible from all application scopes :
var IKUtils = Class.create();
IKUtils.prototype = {
initialize: function() {
},
getRITUsers: function() {
var user_sys_ids = [];
var group_members = new GlideRecord('sys_user_grmember');
group_members.get('group.name','RIT');
while(group_members.next()){
user_sys_ids.push(group_members.user.sys_id);
}
return "sys_idIN" + user_sys_ids.toString();
},
type: 'IKUtils'
};
Thank you for your help
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 11:39 PM
Ah, okay. Seems like Dynamic filters don't like the return value "sys_idIN...". They will take a straight array of strings though. Unfortunately, when working with multiple values it seems like Reference Qualifiers work one way and Dynamic Filters work another.
return ["97000fcc0a0a0a6e0104ca999f619e5b", "6816f79cc0a8016401c5a33be04be441"]
Dynamic Filters: Works
Reference Qualifier: Does NOT Work
return "sys_id=97000fcc0a0a0a6e0104ca999f619e5b,6816f79cc0a8016401c5a33be04be441"
Dynamic Filters: Does NOT Work
Reference Qualifier: Works
You'll have to make two different Dynamic Filter Options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 11:39 PM
Ah, okay. Seems like Dynamic filters don't like the return value "sys_idIN...". They will take a straight array of strings though. Unfortunately, when working with multiple values it seems like Reference Qualifiers work one way and Dynamic Filters work another.
return ["97000fcc0a0a0a6e0104ca999f619e5b", "6816f79cc0a8016401c5a33be04be441"]
Dynamic Filters: Works
Reference Qualifier: Does NOT Work
return "sys_id=97000fcc0a0a0a6e0104ca999f619e5b,6816f79cc0a8016401c5a33be04be441"
Dynamic Filters: Does NOT Work
Reference Qualifier: Works
You'll have to make two different Dynamic Filter Options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2017 12:55 AM
Thank you Matthew, you're right But it's weird since there's a possibility to make a Dynamic Filter Option available on both Ref Qualifier and Filter