- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2019 01:28 PM
Hello,
I'm trying to filter a list of groups that a reference field shows using this as my advanced reference qualifier.
javascript:'sys_idIN' +getMyGroups()+^nameNOT LIKEApproval
Problem with this is that, only the 'nameNOT LIKEApproval' is working. The first half doesn't work unless I remove second half of that condition.
I'm new with reference qualifiers so I have no clue what I have to do. I am assuming I might have to write script include but what would that looks like?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2019 02:48 PM
This is solved using the Reference qualifier below:
javascript:'sys_idIN'+getMyGroups()+'^nameNOT LIKEApproval'
compare to original question
javascript:'sys_idIN' +getMyGroups()+^nameNOT LIKEApproval
Just had to add quotes around the second part of it and removed a space in the first part.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2019 01:32 PM
Change "getMyGroups()" to gs.getUser().getMyGroups().
Please mark this as correct/helpful if this resolved your issue!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2019 01:32 PM
use gs.getUser().getMyGroups(); instead of getMyGroups();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2019 01:49 PM
Hi there,
Below an example of a reference qualifier filter using a script include :
Reference Qualifier: javascript:new refQualifiers().getGroups(current);
Script include: refQualifiers
Note: Client Callable can be left unchecked as it is a server side function
Below script return an Encoded query. Below is a result of sysid's. Be aware that this can be any type of Encoded query.
var refQualifiers = Class.create();
refQualifiers.prototype = {
initialize: function() {
},
getGroups:function(current) {
// Your code using scripting
sysids = '....,....';
//Return an Encoded Query
return 'sys_idIN' + sysids;
},
type: 'refQualifiers'
};
regards, Peter
Please mark this as correct or helpful (in case it is :-)), so other people can find it too
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2019 02:48 PM
This is solved using the Reference qualifier below:
javascript:'sys_idIN'+getMyGroups()+'^nameNOT LIKEApproval'
compare to original question
javascript:'sys_idIN' +getMyGroups()+^nameNOT LIKEApproval
Just had to add quotes around the second part of it and removed a space in the first part.