Can you get the UserName From The Role?
Posted on 2004-11-30
Using Qwaletee suggestion. I am sure you can see how this works. Can we make this work in reverse.
I would like a button named Pick Role -> The form underneath has a field that displays the Roles in the ACL or could even look for a specific Role - Example The button would be named Pick DE Role and then the field would be populated with users assigned to the Role DE? Right now we pick the name and then we get the role, I need to pick the role and get the names. I really like the way Qwaletee set this up, so I would like to continue with it.
First, add a field to the form called NameFromACL, computed when composed, value ""
Second, add a field called RolesForACLName, allow multiple values, computed when composed, value ""
Third, add a button labeled "ACL Roles" with the following formula:
Next, create a subform. Copy the same two fields to the subform.
Change the first field (NameFromACL) to type Dialog List, choices frmo ACL, enable refresh fields on keyword change.
Hide the second field.
Then, put the following code in the QueryClose of the subform:
source.Document.ReplaceItemValue "RolesForACLName" , source.Document.parentDatabase.acl.getEntry(Source.FieldGetText("NameFromACL")).roles