AboutPaski K. Paskaradevan Expertise I have 3 + years in Lotus Notes application development. I am a CLP R5 Application Development. I can answer any question pertaining to application development.
Experience R5 CLP. In addition, I have a bachelors degree in Engineering and a MBA.
Question QUESTION: Hi,
I have an agent that will detach email attachments.I have to check the inbox for new emails.so I use unprocessed documents property but it returns all the documents in the database instead of the unprocessd documents.
Heres my code
Set dc=db.unprocesseddocuments
For a=1 To dc.count
Set doc=dc.GetNthDocument(a)
Call funcExtr(doc)
Next
The next time I run also it shows the same number for dc.count.
ANSWER: Hi Nancy,
You should do two things to solve this.
1. Your agent should run on newly Received mail documents (agent setting).
2. Then you have to mark every document as having been processed using the UpdateProcessedDoc method.
I also think that your agent cannot be called from a view action.
Try this. It should work.
Regards.
Paski
Only problem with this method
---------- FOLLOW-UP ----------
QUESTION: I have added the statement
Call updateprocesseddocument(doc) after the Call funcExtr(doc) before the Next statement and now it works fine.
Is that correct or should I add that statement inside the function so that there won't be any mismatch in the run time.Thanks for your response
ANSWER: Hi Nancy,
It does not matter where this method is called, since you are selecting the document, calling the function and then marking it as processed. There should be no problem at all.
It will not affect the run time as well.
I am glad that you got it working. Very good. :)
Regards.
Paski
---------- FOLLOW-UP ----------
QUESTION: Hi,
It works for that session.And the next time it again starts the same thing.It again takes all the emails into account instead of the unproccessed emails.
Answer Hi,
I forgot to ask you if you are writing this agent in R6 or R7. If it is R7, there is a GetModifiedDocuments method where you can specify a time stamp and type of document which will suite your purpose.
Regards.
Paski
Hi,
If the agent is saved or modified, it loses the processed flag (it is not a physical flag on the document).
Set the Trigger of the agent as follows.
Trigger of this agent should be "On Event" and "After new mail has arrived".
If this does not work, then you will have to flag the processed document using a field on the form. And re write your agent to look for documents without this flag.