Manage Learn to apply best practices and optimize your operations.

Prohibit Document Deletion Based On Field Values

This Database Script will prohibit deletion of documents based on field
It functions regardless of the user's access.
One application is to keep database owners from deleting system critical
documents. (i.e. keyword lists)

The criteria used in this example is relatively simple. Real world applications
may require more complex criteria.

By the way, you might want to change the error message.
This example assumes a form containing a keyword field named 'FormName'.
The two choices for this field are:
Do Not Delete | N
Delete | Y

Place the following in the Database Script:

Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
Dim DocsDelDC As NotesDocumentCollection
Dim DeleteMe As Integer
Dim doc As notesdocument

Set DocsDelDC = Source.Documents

Set doc = DocsDelDC.GetFirstDocument

While Not(doc Is Nothing)
Continue = True

'Never delete these docs per the following criteria.
If doc.FormName(0) = "N" Then
Continue = False
Print "One or more of the documents selected may not be
Messagebox "You Can't Delete Me . . . ", 48, "NaNa NaNa Boo
Exit Sub
End If

Set doc = DocsDelDC.GetNextDocument(doc)

End Sub

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...