JAVA/CORBA CLASSES


unprocessedSearch method
Example

Given selection criteria, returns documents in a database that:


Defined in

AgentContext

Syntax

public DocumentCollection unprocessedSearch(String formula, DateTime limit, int maxdocs)
   throws NotesException

Parameters

String formula


DateTime limit
int maxdocs
Return value

DocumentCollection


Usage

This method is valid only for agents.

How does it work?

This method works in two parts:


For example, in an agent that runs on all selected documents in the view, unprocessedSearch searches only the selected documents and returns those that match the selection criteria. In an agent that runs on all new and modified documents since the last run, unprocessedSearch searches only the documents that were not marked by updateProcessedDoc, and returns those that match the selection criteria.

What documents are returned?

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

Agent runs on:unprocessedSearch returns documents that meet all of these requirements:
All documents in databaseMeet the search criteria specified in Agent Properties box

Meet the formula search critieria specified in this method

Meet the cutoff date specified in this method

All new & modified documentsNot processed by this agent with updateProcessedDoc

Created or modified since the agent last ran

Meet the search criteria specified in Agent Properties box

Meet the formula search critieria specified in this method

Meet the cutoff date specified in this method

All unread documents in viewAre unread and in the view

Meet the search criteria specified in Agent Properties box

Meet the formula search criteria specified in this method

Meet the cutoff date specified in this method

All documents in viewAre in the view

Meet the search criteria specified in Agent Properties box

Meet the formula search criteria specified in this method

Meet the cutoff date specified in this method

All selected documents Are selected in the view

Meet the search criteria specified in Agent Properties box

Meet the formula search criteria specified in this method

Meet the cutoff date specified in this method

NoneIs the current document only

Using updateProcessedDoc

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

The updateProcessedDoc method 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.

Language cross-reference

UnprocessedSearch method in LotusScript NotesDatabase class

EditSelectByDate @command function in formula language

Example
See Also