- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-27-2020 05:44 PM
Remember that you can create a global function that can be called whenever you need in the back-end.
In this particular case the members of a group must be pulled in order to filter a User reference field in the form by a Group reference field in the same form. This is a typical example of Assignment Group and Assigned To inter-dependency. When you choose a group in the Assignment Group field, the Assigned To field should only display user members of the group selected.
With a simple global business rule you can filter the Assigned To field easily:
function getGroupMembers(fieldName) {
var groupValue = current.getValue(fieldName);
if (gs.nil(groupValue)) {
return "active=true^EQ";
}
var member = new GlideRecord("sys_user_grmember");
member.addQuery("group", groupValue);
member.query();
var list = [];
while (member.next()) {
list.push(member.getValue("user"));
}
return "sys_idIN" + list.toString();
}
Here an example:
Easy, clean and practical in the data dictionary of the Assigned To field:


- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the post.
Just to clarify that this can be done, easily, without any of this by just setting the dependency of the assigned_to field...to that of the assignment_group, which is already an OOB setting and set for the assigned_to field on the Incident table, for example:
This filters the users that show within the assigned_to to those of the assignment_group.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
In the base system, there is a global business rule Report Helpers that contains a function with that name. If you want to create your own function, consider giving it a different name to avoid conflicts. By the way, this is one of the reasons why using global business rules is generally not a good practice.