Solved

Agent/Script to run on Doc Delete?

Posted on 2004-09-09
4
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12020890
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
ID: 12021251
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
ID: 12021341
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
ID: 12026746
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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