• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Trap Document Deletions

I'm looking for a method that can prevent a document from being deleted under certain circumstances. I have a database that keeps track of employee benefits & Insurance plans. I don't want to allow deletions of a plan if it is currently selected on an employee document. I'm running Notes 4.6.1.

How can I trap the deletion from both the Views & the Form? I know I can trap it in the Queryclose event of the form, but how about the view. Also, is there a way to tell if the document is being deleted? (I can't find an @IsDocBeingDeleted function or Object property). Ideally, I check this property, then see if there are any employee records that reference the current document &, if found, set Continue = False to prevent the deletion.

  • 2
1 Solution
u have to put the code in the database event:
u find this under design-other-Database script
RayboneAuthor Commented:
That did the trick!!!


Have a great holiday & survive Y2K
Also use source.documents to capture all the docs that have deletion stub next to them.  Just incase u didnt know this.
Thanx and u too have a merry xmas and a great y2k:)


Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now