I wrote a script that evaluates if a user is assigned a role or not. However, in the ACL I have a group listed not individuals and I am getting an error “Object variable not set”. I am guessing because they are in a group and not individual is the problem.
Here is my script:
Dim ss As New NotesSession
Dim ws As New Notesuiworkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim acl As NotesACL
Dim entry As NotesACLEntry
Dim Roles As Variant
Dim username As String
Set db = ss.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
username = ss.UserName
Set acl = db.ACL
Set entry = acl.GetEntry(username)
Forall r In entry.Roles 'Error stops at this line in the debugger
If r = “[VP]” And doc.Amt1(0) < 2500.01 Then
Messagebox “OK”,64, “Approval Checked”
Else
Messagebox “Your are not authorized for an amount greater than 2500.00”, 16, “Approval Amount”
End If
End Forall
Any suggestions?