Solved

Agent/Script to run on Doc Delete?

Posted on 2004-09-09
4
232 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Notes 8.5.2 application on web 4 204
SQL Server linked server to Lotus notes 3 456
See used databases in Domino 8 100
Get files more than 50 GB from F drive on list of servers 8 101
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

929 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

12 Experts available now in Live!

Get 1:1 Help Now