Manage Learn to apply best practices and optimize your operations.

Stopping Deletions

Want to control the deletion of documents from a database? Stop users from
deleting Keyword List documents thus breaking an application or the parent doc
of a chain of responses hence creating orphans that aren't seen in any views.
Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)

Used to control how users delete documents from databases. Helps with
maintaining response heirarchy by eliminating the
possibility of creating orphaned response documents when a deletion of a main
document occurs.

This code turns off the ability of deleting documents in a view via selecting a
document and the pressing the delete key,
unless the workstation's ini file contains the line "NotesDeveloper=True".
NotesDeveloper is a system environment variable
that can be added to the notes.ini by a developer.

For a user to delete a document an action button per form is required to run
the sample following code:
@SetEnvironment("Delete"; "True");
@Command([Folder]; "($Trash)"; "1");

Dim session As New NotesSession
Dim deletedoc As String
Dim developer As String
deletedoc = session.GetEnvironmentString("Delete")
developer = session.GetEnvironmentString("NotesDeveloper", True)

If deletedoc = "True" Or developer = "True" Then
Call session.SetEnvironmentVar("Delete", "")
Continue = False
End If
End Sub
This was last published in November 2000

Dig Deeper on Domino Resources - Part 5

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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 ...