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
values.
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
deleted."
Messagebox "You Can't Delete Me . . . ", 48, "NaNa NaNa Boo
Boo"
Exit Sub
End If

Set doc = DocsDelDC.GetNextDocument(doc)
Wend

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.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close