The soft deletion in the database properties is enabled. When I delete one document (a parent one), I use the Querydocumentdelete in the Database Script to find other related documents.
…
’ This is a kind of child documents
Set collVersion = viewVersion.GetAllDocumentsByKey(docMotCle.DocKey(0))
’ This is a 2nd kind of child documents
Set collPaiement = viewPaiement.GetAllDocumentsByKey(docMotCle.DocKey(0))
If collVersion.Count > 0 Then
Call collVersion.RemoveAll(True)
End If
If collPaiement.Count > 0 Then
Call collPaiement.RemoveAll(True)
End If
’ This is the “parent” document
Call docMotCle.Remove(True)
’ Call docMotCle.RemovePermanently(True)
The child documents are put in the Trash folder which is fine. The problem is that the parent document has an “X” in the left margin of the Trash folder and ask me if I want to delete it. I want the parent document in the Trash folder without asking me to delete it when I exit the database. I try to use the RemovePermanently function, it doesn’t work too.
Any idea will be appreciated. Thanks in advance !
Subject: RE: Soft deletion with Querydocumentdelete
I recently blogged about making soft deletions happen right away. The element you’re missing is that if your event code deletes the document, you don’t need Notes to delete it a second time. Use Continue = False in the event code, and refresh the view yourself in your code (Continue = False tells the Notes client not to do anything, so it doesn’t realize the view has to be refreshed).
Subject: RE: Soft deletion with Querydocumentdelete
I guess in the Querydocumentdelete event it works differently, because it seems not to work with the Continue = False.
The problem is that I don’t want the “X” in the view. In the blog, it seems like you want the “X” in the view.
Thanks !
Subject: RE: Soft deletion with Querydocumentdelete
No, you misunderstood. The problem with the embedded view selection margin was that somebody assumed that all soft deletions would happen the way they do in the mail database – documents move immediately to the trash, no X appears in the view. That isn’t what happens by default, though, so Andre’s blog posting explains how to make that happen. It does exactly what you want it to do.
Subject: RE: Soft deletion with Querydocumentdelete
Well… Finally, it works properly ! My “cache.ndk” file was probably in problem, I reinitialize it, and it works.
Thanks !