i’m having trouble creating a trash for my application. i did as was in the help file and after reading some posts on the forum;create my trash folder named “($Trash)”.
enabled solf deletions,
even added some coding in the delete query:
'---------------------------------------
Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
Dim accessgranted As Boolean
Dim flag As Boolean
Set s = New NotesSession
Set db = source.Database
Set acl = db.ACL
Set entry = acl.GetEntry( s.UserName )
Set CollDocDetruit = source.Documents
accessgranted = False
flag = False
'check for the role
Forall r In entry.Roles
If r = “[Admin]” Then
accessgranted = True
End If
End Forall
'check if don’t have the role if it’s
'in draft, you are allowed since you
'only see your documents
If accessgranted = False Then
Set DocDetruit = CollDocDetruit.GetFirstDocument
While Not DocDetruit Is Nothing
If DocDetruitdoc.AlreadySent(0) <> “0” Then
accessgranted = False
End If
Set DocDetruit = CollDocDetruit.GetNextDocument(DocDetruit)
Wend
End If
If accessgranted = False Then
Messagebox “You can only delete drafts”
continue = False
Exit Sub
Else
'user allowed to delete
Set DocDetruit = CollDocDetruit.GetFirstDocument
While Not DocDetruit Is Nothing
'move to trash
DocDetruit.PutInFolder(“($Trash)”)
Set DocDetruit = CollDocDetruit.GetNextDocument(DocDetruit)
Wend
End If
End Sub
'---------------------------------------
and it still doesn’t seem to be working, when i delete it just gets deleted right away.
you have any suggestions on why it wouldn’t work…or maybe i forgot something?