PROGRAMMING OVERVIEW AND USER INTERFACE


Form formulas
Example

A form formula determines which forms are used for composing and displaying documents under different conditions.

A form formula is optional. Lotus Domino Designer selects a form in the following preference order:

1. Form stored in the document.

2. Form specified in the form formula.

3. Form with which the document was created.

4. Default form for the database.

A form formula must evaluate to the name of a form. To enter a form formula:

5. Open the view in Lotus Domino Designer.

6. Select the Form Formula object on the Objects tab.

7. Enter a formula in the Script area.

Form formulas and creating new documents in a view

A form formula will override the form called by a view action which uses a formula or LotusScript to create a document.

For example, a view has the following form formula:

@If(@IsResponseDoc;"Response";"MainTopic")

This form formula states that a document in the view will be displayed using the Response form if it is a response document, otherwise the MainTopic form will be used. However, if a user attempts to compose a new document using a different form such as "Phone Number" by selecting Create - Phone Number from the Notes menu, the user will see the MainTopic form instead of the Phone Number form. The same is true of view actions that use formulas or LotusScript to compose a new document.

To avoid this problem, add the following line to the form formula.

@If(@IsNewDoc; @Return(Form); "")

You can also incorporate both elements in the same @If statement, as follows.

@If(@IsNewDoc; @Return(Form); @IsResponseDoc;"Response";"MainTopic")

Example
See Also