03 Troubleshooting
Client, Designer
Problem composing forms in views with form formulas

Notes views use a feature called Form Formula to change the form that is used when displaying a Document. Typically a Form Formula will look like this:

@If( Amount > 50; "Big Amount"; "Little Amount");

This formula looks at the current document being opened. If the document has field named Amount and its value is more than 50, then it uses the form Big Amount to view the document, otherwise it uses the form Little Amount.

However, this also causes strange behavior when the user creates a new document while this view is open. If there is a form called Phone Number and the user composes it by selecting Create - Phone Number from the Notes menu while in the same view, he will instead see the Little Amount form. This is because the same Form Formula is executing regardless of whether the user is composing a new document or opening an existing document from the view. The same is true of view actions that use Formulas or LotusScript to compose a new document.

To work around this, the application developer should change the Form Formula to this:

@If( @IsNewDocument; @Return(Form); "");
@If( Amount > 50; "Big Amount"; "Little Amount");

This will restore the expected behavior when composing new documents.