AllExperts > Experts 
Search      

Using Lotus Notes

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Using Lotus Notes Answers
Question Library

Ask a question about Using Lotus Notes
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Paski 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.
 
   

You are here:  Experts > Internet/Online > Email > Using Lotus Notes > Unread Documents

Topic: Using Lotus Notes



Expert: Paski K. Paskaradevan
Date: 12/14/2007
Subject: Unread Documents

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.

Regards.

Paski

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.