- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 10:19 AM
I'm trying to figure out a script which has the syntax mentioned in the question, that is 'active=true^sys_idIN' + function( ). Can someone explain to me what does sys_idIN do here? Does it simply include the sys_id passes to the query as one of the a condition?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:23 AM
Use this
javascript: 'typeLIKExxxx^active=true^sys_idIN' + gs.getUser().getUserByID(user id).getMyGroups().toArray().join() + '^EQ'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:06 AM
This is for a reference qualifier and it is run on a group table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:21 AM
Where i would go with this is to use one function created in a script include to return the whole ref qualifier, and in the ref qualifier, just call the function name.
The code of the script include would be similar to this:
function getMyRequestGroups(){
var refQual = 'active=true';
var gpm = new GlideRecord('sys_user_grmember');
var qry = 'group.typeLIKE#INSERT SYS_I OF REQUEST TYPED#^user=' + gs.getUserID();
var sysIDs = '';
gpm.addEncodedQuery(qry);
while (gpm.next()){
if (sysIDs == ''){
sysIDs = '^sys_idIN' + gpm.sys_id;
}
else{
sysIDs = sysIDs + ',' + gpm.sys_id;
}
}
refQual = refQual + sysIDs;
return refQual;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:32 AM
Thank you. I'll just go through the script you have provided and I'll give you a feedback
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:32 AM
Can you please explain, why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:35 AM
You do not need script include for this. Use my code, you should be good
