DEFAULT (Formula Language)

A reserved word that does one of the following:

  • Assigns a default value to a field.
  • Says that for the duration of the computation of this formula, if a document does not have this field, act as though it does with this as its value.
  • Allows you to assign values that provide dynamic defaults to fields.

Syntax

DEFAULT variableName := value ;

Usage

This reserved word works in any formula.

Use DEFAULT once in a formula. If this keyword occurs multiple times in a formula, the first occurrence is effective and subsequent occurrences have no effect.

Note: Pre-R6 behavior differs: if a formula contains multiple occurrences of DEFAULT, the last occurrence is effective.

Examples

These two formulas display the value in the field named KeyThought, if that field exists; otherwise, the value in the field Topic is displayed. Using DEFAULT lets you write a simpler formula that is less prone to error, and easier for others to understand.
@If(@IsAvailable(KeyThought);KeyThought;Topic); 

and

DEFAULT KeyThought := Topic;
KeyThought;