Hello,
We have a problem of some documents creeping into Inbox folder of a mail in database. So, I am planning to write an agent on the event “Before new mail arrives” so that we can route only the selected documents to the Inbox.
How can I take the handle of the document in the LotusScript code?
Session.documentContext won’t work and DB.unprocessedDocuments will return all unread documents in the Database when the agent will run.
So, what do you guys suggest?
Rgds,
Munish
Subject: Document Handle on before new mail arrives event
what do you mean, on;y the selected document? On a Before New Mail Arrives agent there is only 1 document available to the agent but remember that the agent is actaully run by the router. What exactly do you want to happen?
Subject: RE: Document Handle on before new mail arrives event
Hi Paul,
Thanks for the reply.
Yes, I want to take the handle of that one document and check some conditions before it finally goes to Inbox folder.
In the database, there are some documents which are getting changed and coming into inbox on it own. So, I just want to check that the documents coming into the inbox folder are the mail documents and not any other document.
Hope this explains.
Rgds,
Munish Kaushik
Subject: RE: Document Handle on before new mail arrives event
I think you are confused about the predelivery agent trigger. You say “In the database, there are some documents which are getting changed and coming into inbox” yet you are asking about a “before new mail arrives” (pre-delivery) agent.
Predelivery agents are executed by the router, PRIOR to the router adding the document to the database. In that case, NotesDatbase.UnprocessedDocuments contains only the document (message) to be added. If a document is already in the db and gets added to the Inbox folder by some other method, a pre-delivery agent will never fire/act on it.
Subject: RE: Document Handle on before new mail arrives event
Thanks Jeryy. that saves me from a lot of confusion.