Creating Advanced View Selections

View selection formulas restrict the documents that appear in a view. Only simple searches and a formula created with the Formula language can be used. You can access the view selection formula area by selecting it from the Objects tab in the Programmer's pane, or by clicking the Selection Conditions button in the toolbar. Clicking Simple Search and then the Add Condition button at the bottom of the Programmer's pane displays the Search Add Condition dialog box, shown in Figure 6.12. Multiple conditions can be strung together to create a fairly complex view selection formula. When you save a condition, it is entered in the formula window as a gray bar. If you combine conditions, you will notice additional conditions separated by a Boolean AND . You can edit the condition by double-clicking the text, and you can change the Boolean operator, for example, from AND to OR .

Figure 6.12. The By Field condition in the Add Condition dialog box shows the cCity field selected.

View selection conditions can also be built by using the Notes Formula language. In fact, you can see the Formula equivalents to the Simple Search selection conditions by switching from Simple Search to Formula. Take the following steps to create the selection condition:

  1. Open the view in design mode. Go to the view selection condition and choose Simple Search.
  2. Click the Add Condition button and choose By Form in the Condition drop-down list.
  3. Click the form that you want to use in the window that appears. Click OK.

To see the formula, click Formula in the drop-down list. Domino Designer displays the following formula:

SELECT ((Form = "form name") (Form = "FN"))

The default selection condition is SELECT @All , which selects all documents in the database. You can build far more sophisticated selection conditions with the Formula language than with Simple Search. The Add Condition dialog box is multipurpose and is used in many different places. Because the Add Condition dialog box is general purpose, some of the conditions are not very useful for view selection conditions. Multiple Words and Fill Out Example Form Used are two examples. These are better suited to creating full-text queries than to designing view selection conditions. Nevertheless, building selection conditions with the Search Builder does work for simple selections.

NOTE

Using a selection formula that compares dates with today's date using @Today , for example, causes the Refresh icon to be constantly displayed because the value of @Today is constantly changing. Use the @Function @TexttoTime to convert the time value to a text value instead.

Категории