- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2015 04:14 AM
Hi All,
I am trying to use getMyGroups() reference qualifier for populating only the groups that the current loggedin user is a part of for a new reference field.
I put the following condition in the reference qualifier but I am still able to see all the groups, :
Don't know what I am doing wrong.
Any help would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2016 07:28 AM
Hi Aropprv,
Not sure if you've fixed this yet, but if you haven't have a go at this. We had exactly the same problem. We fixed it by adding the following reference qualifier:
javascript:new BackfillAssignmentGroup12().BackfillAssignmentGroup12()
...and then creating a new client callable Script Include:
Name: BackfillAssignmentGroup12
Script:
var BackfillAssignmentGroup12 = Class.create();
BackfillAssignmentGroupNew.prototype = {
initialize: function() {
},
BackfillAssignmentGroup12:function() {
var gp = ' ';
var a = current.gs.getUserID();
//return everything if the assigned_to value is empty
if(!a)
return;
//sys_user_grmember has the user to group relationship
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('user',a);
grp.query();
while(grp.next()) {
if (gp.length > 0) {
//build a comma separated string of groups if there is more than one
gp += (',' + grp.group);
}
else {
gp = grp.group;
}
}
// return Groups where assigned to is in those groups we use IN for lists
return 'sys_idIN' + gp;
},
type: 'BackfillAssignmentGroup12'
}
Hope that helps
Charles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2018 06:22 AM
Its still not working for me.. i have copy pasted exactly the same content.