Solved

Agent/Script to run on Doc Delete?

Posted on 2004-09-09
4
230 Views
Last Modified: 2013-11-16
Hi all. I have a database, based on the R5 Mail template, on a 5.0.8 Domino box. I would like to set up an agent that triggers an email to be sent to myself whenever a document (calendar entry, to be specific) is DELETED from the database. Using the basic agent setup (View>Agents, etc) I can get this to run when a document is created or edited, but there seems to be no easy way get reports of deletions. If possible, I would like this email to include a copy of the document that has been deleted.

Can anyone help me with some lotusscript or other means to bring this functionality about?

TIA
G
0
Comment
Question by:gregkling
  • 2
4 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
QueryDocumentDelete.. is the event to concentrate. This is available in database script.

Here use the "DOCUMENTS" property and send them to your id ...

eg;

dim col as NotesDocumentCollection
set col = Source.Documents
dim doc as NotesDocument
set doc = col.GetFirstDocument
while not doc is nothing
doc.send true, "username@domain.com"
set doc = col.GetNextDocument(doc)
wend



~Hemanth
0
 

Author Comment

by:gregkling
Comment Utility
I should have pointed out that I am NOT fluent in LotusScript and Domino Designer by a longshot....I can hack my way through with some general direction. (Don't worry, the database isn't mission-critical!)
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Follow my sample code..

First you need designer , after openigng the db in designer.. objects are exposed. Look for Database Script object (others section)
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
Comment Utility
Hi gregkling,

Is this based on the standard mail template?  The mail template already has a (somewhat complex) QueryDocumentDelete script.  Look for the lines:
                If Not (vbeObject.RepeatModify = -1) Then ' SPR #MBRT4FNV9E
                    Call notePlaceHolder.Remove(False)
                End If

That is the point at which the calendar entry gets finished processing.  I would put, ABOVE the IF NOT... line, the following code:

Dim logCalendarDeleteDatabase as New NotesDatabase ("your server" , "a new database that you will create to hold deleted calendar entries.nsf")
notePlaceHolder.copyToDatabase logCalendarDeleteDatabase

Now, you can go into the new database, and look for entries that users have deleted.  You can also build simple views that sort on date deleted or user name.

Best regards,
qwaletee
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now