So I am using querydocument delete I want to write a value once authority has been given, is this possible because I believe my code to be correct however its not working. I am checking to see if the user has the proper role to delete and then if they do write a value to the usercancelled field of the document. Also I am using soft deleteion. Thanks
The reason I am trying to write a value is because I want to distinguish between soft deleted documents and regular documents in the database when I run an agent that uses document collection
Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim userRoles As Variant
Dim session As New NotesSession
Dim user As String
user = session.UserName
userRoles = Evaluate(“@UserRoles”)
Set dc=Source.Documents
Set doc = dc.GetFirstDocument
'Messagebox doc.usercancelled(0), 0, “Cancelled value”
Messagebox (“test”)
Do Until doc Is Nothing
Forall role In userRoles
If Ucase(role) = “[UEEDITOR]” Then
'If doc.Form(0) = “Appt” Then
If Not doc.Person(0) = user Then
Continue=False
Messagebox ( “Your are not permitted to delete reservations, please contact the owner for changes”)
Exit Forall
End If
End If
End Forall
doc.editmode=True
doc.usercancelled = “yes”
Call doc.Save( False, True )
Set doc=dc.GetNextDocument( doc )
Loop
End Sub