Subject: Accessing List of users with a specific role for field entry choice
Thanks to both of you for responding so quickly.I’ve been working on some of the suggestions and think I’ve found the solution through the suggested multiple fields.
Step 1:
Create two unique, hidden fields (PeopleGM & PeopleApprover) that will eventually be used to populate dialoge boxes for choice selection (in step 3).
Step 2:
Create PostOpen script for Form which will populate those two unique fields (step 1) with the names associated with each of the respective roles (each unique field then represents the subset of ACL entries that have the particular role assigned). Script follows:
Sub Postopen(Source As Notesuidocument)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Dim roleName As String
Dim foundRole As Variant
Set uidoc = workspace.CurrentDocument
Set db = session.CurrentDatabase
Set acl = db.ACL
roleName = “[GM]”
Set entry = acl.GetFirstEntry
While Not ( entry Is Nothing )
If entry.IsRoleEnabled( roleName ) Then
Call uidoc.FieldAppendText _
( “PeopleGM”, entry.Name & “;” )
End If
Set entry = acl.GetNextEntry( entry )
Wend
role2Name = “[Approver]”
Set entry = acl.GetFirstEntry
While Not ( entry Is Nothing )
If entry.IsRoleEnabled( role2Name ) Then
Call uidoc.FieldAppendText _
( “PeopleApprover”, entry.Name & “;” )
End If
Set entry = acl.GetNextEntry( entry )
Wend
End Sub
Step 3:
Create 2 DialogBoxes forms (PickGM and PickApprover)-- one for each field. Each dialog box contains list box field which provides only choices that pull from the unique fields established in step one.
Step 4: GM and Approver fields in Dialog boxes are linked to the two fields (GM and Approver) in the main form, which I originally wanted to pull from the ACD, and populate the main form when the selection is made.
The result is a dialog box that opens for the “GM” choice field with a list of individuals in the ACL with role “GM”. The other result is a dialog box that opens for the “Approver” choice field with a list of individuals in the ACL with role “Approver”.
Thanks again for your help!!
Tom Haller