APPLICATION DESIGN


Examples: Programming documents to display in a view
The following examples describe various scenarios for selecting documents to display in a view.

Selecting documents by form name and field value

If a database contains an Action Item form with a Status field, a view in the database can select all documents created with the form whose Status field has the value "Open." The document selection formula is:

SELECT Form ="Action Item" & Status="Open"

Selecting only non-response documents

To select only documents that were created with main document forms, and exclude documents created with response or response-to-response forms, use this formula:

SELECT !@IsResponseDoc

Selecting main and response documents

If a database contains an Action Item form, you can select all documents that were created with the Action Item form, as well as responses to these documents, using the formula:

SELECT Form = "Action Item" | @IsResponseDoc

Selecting documents not created with a specified form

The Databases by Title view in the Database Library template selects all documents that were not created with the Librarian form using this formula:

SELECT Form != "Librarian"

Selecting conflict documents

When two or more users make changes to the same document in different replicas of a database, conflicts occur when replication updates the databases. A database displays conflict documents as responses to the original document. In order to resolve conflicts, you may want to design a view that displays only the conflict documents.

To display conflict documents in a view, make sure the options "Display responses in a hierarchy" is not checked on the Options tab of the View properties box. Enter the following as the view selection formula:

SELECT @IsAvailable($Conflict)