SELECT (Formula Language)

The SELECT reserved word defines criteria for the selection of documents in an agent that runs a formula, in a view, or during replication. You use a SELECT statement before an expression to define the set of documents that you want to change, see in a view, or replicate.

Syntax

SELECT formula ;

Usage

  • In an agent, you can use the Agent Properties box to select the documents you want to act upon.
  • In an agent that runs a formula, you can include a SELECT statement in the formula. The agent acts upon the documents selected with the Agent Properties box and the documents selected by the SELECT statement.
  • In a view, you can use the Search Builder to select the documents you want to see in the view. You can use SELECT to select documents and provide more complicated conditions for replication.
  • For selective replication, you can use the Search Builder to select the documents you want to replicate. You can use SELECT to select documents and provide more complicated conditions for replication.

Using SELECT in the formula eliminates the need to go through the database to select the documents. You can run the filter macro on all the documents in the database, and the SELECT statement performs the selection process.

The word SELECT is automatically prepended to the view selection formula when the formula is saved.

Use SELECT @All to select all documents for an operation (for example, use it in the selection formula for a view that displays all of the database's documents). @All should never be used without the SELECT reserved word. If your formula contains @All by itself, Notes/Domino appends the SELECT @All statement to your formula:

@All;
SELECT @All;

If you compare a field to a value (for example, Year > 1995) and the field is unavailable, the comparison is false. However, you should check for fields that may not be present with @IsUnavailable.

This reserved word does not work in column, hide-when, section editor, window title, hotspot, field, form, or form action formulas.

SELECT is not intended for use in toolbar buttons.

Examples

  1. You want to change the contents of the Status field in several documents to Closed. However, you do not want to change the Status field of any document that contains the value Unsigned Contracts in the Categories field.

    To make the desired change, you write and run an agent that runs a formula. When you write the formula, you specify the documents that you want Notes/Domino to scan to make the change. By adding a SELECT statement to the formula, you can further limit the documents that Notes/Domino looks at when you run the agent.

    SELECT Categories != "Unsigned Contracts";
    FIELD Status := "Closed";
  2. This replication formula limits replication to documents that contain a Year field whose value is greater than 1995.
    SELECT @IsAvailable(Year) & Year > 1995
  3. This replication formula limits replication to documents that do not contain a Year field or whose Year field is greater than 1995.
    SELECT !@IsAvailable(Year) | Year > 1995