Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

NoDeletionCol.gifI saw a question this morning in the 5/6 forum about embedded views and the fact that they don't show the part of the selection margin that displays an X when the document is flagged for deletion.

Actually, this is only true if the "Allow soft deletions" database property is enabled. This is SPR# RGAU73VJF2. Some developer at Lotus who shall remain unnamed, apparently assumed that if you used this database property, the deletion mark in the embedded view wasn't needed because when you delete a document, it would just be gone, so there would be no need to flag it. This is the way it happens in the mail file.

As I discovered after playing around with this option for a bit, that's not how it works. When you enable soft deletions (and create a Trash view) and do nothing else, there's no difference whatever in the client UI. If the user presses Del, the document is marked for deletion with an X -- same as before. When they refresh the view or exit the database, they're asked if they really want to delete the documents -- same as before. The only difference is in what happens after that point -- rather than being erased for good, the flagged documents are shifted to the Trash view (which may have a different name and is often called "($SoftDeletions)" because this makes it show up as the traditional trash folder in the outline.

To duplicate the behavior of the mail file, where you press Del and the document is gone, requires one additional step. You have to add a Querydocumentdelete event in the database script that just goes ahead and deletes the documents immediately. For instance:

Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
       Dim col As NotesDocumentCollection
       Set col = Source.Documents

       col.RemoveAll False

       Dim wksp As New NotesUIWorkspace


       Continue = False

End Sub

If you look at this event in the Notes mail application, you will see it's considerably more complex than this, but this is basically what needs to happen -- you have to override the default behavior of flagging documents with an X and make something happen right away.

Andre Guirard | 7 March 2008 11:02:41 AM ET | Dunn Bros. Coffee, Golden Valley, MN, USA | Comments (9)

Search this blog 


    About IBM Privacy Contact