Querydocumentdelete how to write value

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

Subject: Querydocumentdelete how to write value

Please ignore the above, I have decided to use isdeleted in my agent so it will ignore these documents.

Subject: Querydocumentdelete how to write value

Look at my SuperNTF template (www.superntf.org) for some good examples of handling soft deletions. No time to directly address your question but thought I’d throw that out as there may be some useful code in there.

Good luck,

Kevin

http://www.lotusguru.com