Related list Group - Service related to sys_user_group

gugaj
Tera Contributor

Does anyone have a suggestion on how I set up a Query for a new related list on SYS_USER_GROUP that shows all services that are related to the sys_user_group? The servis have already a relation to support_group
I have to get this information by going to Service that has a relationship to group because the group has no service attribut, but service has this relation to group.
The relationship between Service and group already exists. A service has a support_group but a support_group has no service

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

If your queries from table is the service table which has a field named support_group, the query would be

(function refineQuery(current, parent) {
    current.addQuery('support_group', parent.sys_id);
})(current, parent);

 

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

If your queries from table is the service table which has a field named support_group, the query would be

(function refineQuery(current, parent) {
    current.addQuery('support_group', parent.sys_id);
})(current, parent);

 

Thanks for the quick feedback! It works as expected with your query 🙂

Another question, if in the same query I want to retrieve another field called "managed_by_group"  from the same table, how do I do this?

If you're saying you want the displayed group record to be either the support_group or the managed_by_group on the queries from table, this will do that

(function refineQuery(current, parent) {
    current.addEncodedQuery('support_group=' + parent.sys_id + '^ORmanaged_by_group=' + parent.sys_id');
})(current, parent);