Home > Domino Tips > Developer > Other > Prevent document deletion if there are response documents
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

OTHER

Prevent document deletion if there are response documents


Mark Burbank
03.07.2005
Rating: -4.60- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This tip shows you how to prevent document deletion if there are response documents.

Just put this code in the Database script, in the Querydocumentdelete event:


Sub Querydocumentdelete
(Source As Notesuidatabase, 
Continue As Variant)
 
 'Get a handle on the current document
 Dim ns As New NotesSession
 Dim nDocCurrent As NotesDocument
 Dim ndcCollection As NotesDocumentCollection
 Set ndcCollection = Source.Documents
 Set nDocCurrent = ndcCollection.
GetFirstDocument
  
 'See if the current document has 
any responses associated with it
 'if so do not allow the deletion
 
 Dim ResponseCollection As 
NotesDocumentCollection
 Set ResponseCollection = nDocCurrent .Responses
 numDocs& = ResponseCollection.
Count '# of response documents
 If numDocs& > 0 Then
  Messagebox "You cannot delete 
this document because it has 
responses below it!",64,"Action Cancelled"
  Continue = False
 End If
 
End Sub

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Mark Burbank. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Other
Create a dynamic user-driven navigator for a Notes/Domino application
How to apply XSL style sheets to XML views
Comparing replicas on clustered Lotus Domino servers
Creating a Lotus Notes view column categorized by month
Using the XMLHTTP object for integration with Domino or any RDBMS back end
Hiding field properties/data from DocProperties box
Export a view to Excel without coding
Switching between test IDs quickly
AddParameter to a NotesXSLTransFormer
Using DXL (Domino XML) to review/modify documents

Lotus Notes Domino Application Development
Create a dynamic user-driven navigator for a Notes/Domino application
Top 10 Lotus Notes/Domino coding and development tips of 2008
Lotus Notes Domino application development best practices
Mimic Lotus Notes Domino application functionality on the Web
Top 10 issues when developing Lotus Notes Domino Internet applications
Top 10 Lotus Notes Domino programming and development tips of 2007
Export Lotus Notes documents to Microsoft Word via Internet Explorer
A bevy of Notes/Domino development tips
How to protect your Lotus Notes application design
Adding an action to the Lotus Notes right-click menu

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts