Unprocessed documents - conundrum?

I am building a customized archiving agent with script. In it I want to walk through all of the documents I have selected in a view. I would like to use the db.unprocessedDocuments property to get a notesdocumentcollection (dc).

What I am confused about is that in the script, I first set the dc, then loop through the documents, checking some stuff before archiving each document. The only way I can get the agent to properly populate the dc is to set the agent to “RUN ON ALL SELECTED DOCUMENTS”.

If this is the case, will the agent run completely through its script for EACH ONE of the documents I have selected, which would be redundant at best, and will not find the documents still there since my script deletes the documents as it goes through its paces?

Maybe I am just missing something basic here. Can someone give me a hand? I can explain further if needed.

Thanks,

Matt

Subject: Unprocessed documents - conundrum?

Matt,

For Lotusscript agents the type of agent determines which documents are considered unprocessed. It does not perform the same agent on every selected document again and again (like it does with formula language agents).

So setting the agent to “Run on all selected documents” means that the UnprocessedDocuments property returns all documents that are selected. The agent will perform its action on those documents only once.

More information you can find in the help under UnprocessedDocuments property for Notesdatabase class.

Hope this clarifies it a little.

Rene

Subject: Unprocessed documents - conundrum?

If you are going to select the list of documents from your LS code, then set the agent Target to “None”. This means that the agent is expecting you to make the determination of which documents to process.