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
Solved

Agent/Script to run on Doc Delete?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Recent Contacts - Lotus Notes 10 691
Connect SQL Server from Lotus Domino Application 7 355
Bulk lotus notes account creation 3 88
Lotus Notes Calendar Issue 5 113
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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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