HiI’m really new in LS and so far a use trail and error to learn myself. But here i not have a clue to what i should do.
I use this in Querymodechange, but now they want to edit it if there is more then 12 hours left before the time they set in datefield “DateOK” and the field “OK” is not checked.
If OK is checked nothing should happend because when OK i checked the authors and readers field are correct. So the document should skip the Querymodechange in this case.
Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
' check that editor is member of selected uint
If Not source.EditMode Then
Dim session As New notessession
Dim ws As New NotesUIWorkspace
Dim docUnit As notesdocument
Dim view As notesview
Dim db As NotesDatabase
Dim item As NotesItem
Dim doc As NotesDocument
Dim result As Variant
Dim hasRole As Variant
Set doc = source.Document
' check roles
result = Evaluate(|@UserRoles|, doc)
hasRole = False
Forall n In result
If n = "[Admin]" Or n= "[DatabaseConfig]" Then
hasRole = True
Messagebox "Your not allowed to edit this document." & unit$ , 0+16, "Error!"
Continue = False
End If
End Forall
End If
End Sub
Kind regards
Leon