Skip to main content

UnprocessedDocuments (NotesDatabase - LotusScript)

Read-only. The documents in a database that the current agent or view action considers to be "unprocessed." The type of agent determines which documents are considered unprocessed.

Note: This property is not implemented in COM.

Defined in

NotesDatabase

Data type

NotesDocumentCollection

Syntax

To get: Set notesDocumentCollection = notesDatabase .UnprocessedDocuments

Usage

This method is valid only for agent or view action scripts and may be invoked only on NotesDatabase objects obtained from the CurrentDatabase property in NotesSession. In scripts that are not a part of an agent or view action, this method returns a NotesDocumentCollection with zero documents. When invoked on a NotesDatabase object that was not obtained from the CurrentDatabase property, this method raises an error.

The database must be open to use this property.

What documents are returned?

The following table describes the documents that are returned by the UnprocessedDocuments property. Document selection occurs once, before the agent runs.

Agent runs onUnprocessedDocuments returns documents that meet all of these requirements
All documents in databaseMeet the search criteria specified in Agent Properties box
All new & modified documentsNot been processed by this agent with UpdateProcessedDoc
Created or modified since the agent last ran
Meet the search criteria specified in Agent Properties box
All unread documents in viewAre unread and in the view
Meet the search criteria specified in Agent Properties box
All documents in viewAre in the view
Meet the search criteria specified in Agent Properties box
All selected documents
or
View actionAre selected in the view
Meet the search criteria specified in Agent Properties box
NoneIs the current document only
Before New Mail ArrivesNone (does not return any documents; use NotesSession.DocumentContext instead)
After New Mail ArrivesMailed to the database since the agent last ran
Meet the search criteria specified in Agent Properties box
Newly modified documentsModified since the agent last ran
Meet the search criteria specified in Agent Properties box
Pasted documentsPasted into the database since the agent last ran
Meet the search criteria specified in Agent Properties box

Using UpdateProcessedDoc

For agents that run on new and modified documents, newly received mail documents, pasted documents, or newly modified documents, you must use the UpdateProcessedDoc method in NotesSession to mark each document as "processed," which ensures that a document gets processed by the agent only once (unless it's modified, mailed, or pasted again). If you do not call this method for each document, the agent processes the same documents the next time it runs.

UpdateProcessedDoc marks a document as processed only for the particular agent from which it is called. Using UpdateProcessedDoc in one agent has no effect on the documents that another agent processes.

In all other agents and view actions, UpdateProcessedDoc has no effect.

View actions

When used in a view action, UnprocessedDocuments returns the same documents as an agent that runs on selected documents.

Example