- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 03:23 PM
Hello Community,
I would like users who are members of 'Generic Group' and are currently logged in to have access and to be able to see all the Assignment groups available on the Incident form. On the other hand, if a user who is currently logged in, is not a member of the 'Generic group', the group name 'Hidden Group' shall be hidden from that user.
My organization already has a script include in the assignment group field reference qualifier. I created a script include and tried to use it in addition to the my organization's script include and I also tried to use mine by itself but it still did not work.
Reference Qualifier:
javascript: myGroupFilter();
Script Include:
var myGroupFilter = Class.create();
myGroupFilter.prototype = {
initialize: function() {
if (gs.getUserID().isMemberOf('Generic Group'))
{ // User Can see all records
return;
}
else
{
return 'name!=Hidden Group'; // If user is not a member of the Generic Group Name then HIDE this Assignment group field.
}
},
type: 'myGroupFilter'
};
Below is what I had, I removed my organization's script include but it still did not work?
javascript: myOrganizationScriptInclude()+myGroupFilter();
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 11:55 AM
try
javascript: new MyOrgScriptInclude().getOrgQuery(current.u_org_field) + '^'+ new MyOrgScriptInclude().filter();
also change
var myGroupQuery = Class.create();
myGroupQuery.prototype = {
filter: function(){
if (!gs.getUser().isMemberOf('Generic Group Name')){
return 'name!=Hidden Group';
}else{
return '';
}
},
type: 'myGroupQuery'
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 05:22 PM
try
javascript: new myGroupFilter();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 06:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 11:54 AM
Mike,
I inserted the script include within my organization's pre-existing script include, the function works by itself but when I try to combine them in the ref qual, it does not work. All I did is add a plus sign to it. Is there another way of doing it?
javascript: new MyOrgScriptInclude().getOrgQuery(current.u_org_field) + new MyOrgScriptInclude().filter();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 11:55 AM
try
javascript: new MyOrgScriptInclude().getOrgQuery(current.u_org_field) + '^'+ new MyOrgScriptInclude().filter();
also change
var myGroupQuery = Class.create();
myGroupQuery.prototype = {
filter: function(){
if (!gs.getUser().isMemberOf('Generic Group Name')){
return 'name!=Hidden Group';
}else{
return '';
}
},
type: 'myGroupQuery'
};