Domino 9 und frühere Versionen > Entwicklung

Rollen über Maske steuern?!?!

<< < (3/3)

Silver:
Ich habe jetzt folgende Formel um die Personen, die der Rolle "GL-MAR" zugeornet sind, in einem Feld anzuzeigen.

   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
' add brackets to role
   roleName = "[GL-MAR]"
   foundRole = False
' check to see if the role exists in the database
   Forall r In acl.Roles
      If ( r = roleName ) Then
         foundRole = True
         Exit Forall
      End If
   End Forall
   If ( foundRole = False ) Then
      Messagebox _
      ( "Sorry, " & roleName & " is not a role" )
' if the role exists, check each acl entry to see if role
' is enabled for entry
' if so, add entry name to the People field
' on the current document,
' followed by a semicolon, the multi-value separator
   Else
      Set entry = acl.GetFirstEntry
      While Not ( entry Is Nothing )
         If ( entry.IsRoleEnabled( roleName ) = True ) Then
            Call uidoc.FieldAppendText _
            ( "People", entry.Name & ";" )
         End If
         Set entry = acl.GetNextEntry( entry )
      Wend
   End If
' refresh current document so People field displays nicely
   Call uidoc.Refresh

Allerdings bekomme ich beim Öffnen der Maske die Fehlermeldung, dass im Bearbeitungsmodus geöffnet sein muss. Habe aber bei der Maske angegeben, dass das Dok. immer bearbeitbar geöffnet werden soll. Was muss ich noch umstellen?

koehlerbv:
Wo hast Du denn den Code zu stehen ?

Spalter:
Hallo Silver,

das fehlt hier noch:

uidoc.EditMode = True

Gruß
Spalter ;)

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln