Filter Assignment Group field by hasRole

denisdoucet
Tera Guru

I've created a new application to which I have extended the Task table.
I have 2 type of groups, one of which will have an admin role associated to it and all others will have a user role associated to it.

I want to filter the the assignment_group field to only show groups that contain both the admin and the user roles.

I've come across articles for reference qualifiers but it seems like it's converting my Assignment Group reference field to a select box.

I'm looking for best practice and possible approaches on how to set this up for my application and not mess with other applications that have the Task table extended to it.

Thanks in advance.

1 ACCEPTED SOLUTION

I did some investigating in my developer instance and found some interesting ways you can get around this depending upon how your Assignment group [assignment_group] field is defined on the base table.

If you have the Choice List Specification defined, you may also have an attribute set as well:
ref_auto_completer=AJAXReferenceChoice

If that is set, you can use your Dictionary override to set an attribute which defines the threshold to switch from a menu to be an actual reference field:
max_ref_dropdown=1

I just tested this and determined that even if you do not have the ref_auto_completer set to AJAXReferenceChoice, the above max_ref_dropdown attribute will still force the field to be a reference field, especially if you have more than 1 group to select from.

View solution in original post

7 REPLIES 7

ccajohnson
Kilo Sage

It sounds like you want to look for group records that have roles associated with them. A better approach would be to use Group Types and that way you can add a group type to those groups you want included in your custom application. This would be more efficient because the reference qualifier would only need to look at the Group records and not perform a secondary lookup on the sys_group_has_role table.

Let me know if you want more information on Group Type records and how to apply them to a group record for filtering purposes.

Do I need to configure a Dictionary Override on the Assignment Group field for my table and from there configure a reference qualifier for my group type?

Yes, if you have extended your custom table from Task and are using the Assignment group field on your form.

For some reason, as soon as I apply a reference qualifier to this field it turns into a select box, as opposed to a reference field.

find_real_file.png