FORMULA LANGUAGE


Order of evaluation for formula statements
Lotus Domino evaluates formulas from top to bottom and left to right, completing each statement before proceeding to the next, except that @PostedCommand and a few @Command functions are executed in order after all other @functions complete execution. Formula language contains several @functions for control logic.

Except for @commands, the formula language operates on back-end Notes objects. For example, a field named in a formula refers to the field as it exists in storage and the FIELD reserved word modifies a stored field. @Commands operate in the user interface; changes made there are not reflected in the back-end until a document is saved. You cannot intersperse back-end and user interface accesses of the same document and get correct results.

Evaluation of @commands

Execution of an @PostedCommand function occurs after all other @functions in the formula. For instance, look at the following formula:

@PostedCommand([CommandName]; Argument);
@If(Condition; TrueStatement; FalseStatement);
FIELD X := "Text"

The first statement is executed last.

Execution of an @command function occurs in the order it appears with some exceptions. The exceptions, like @PostedCommands, execute at the end of the formula. Each exception has an equivalent @command that executes immediately.

The following table lists the @commands that execute last and their corresponding @commands that execute immediately.

Note The functions that get evaluated immediately are new with Release 6.
Evaluated after @functionsEvaluated immediately
EditClearClear
EditProfileEditProfileDocument
FileCloseWindowCloseWindow
FileDatabaseDeleteDatabaseDelete
FileExitExitNotes
FolderFolderDocuments
NavigateNextNavNext
NavigateNextMainNavNextMain
NavigateNextSelectedNavNextSelected
NavigateNextUnreadNavNextUnread
NavigatePrevNavPrev
NavigatePrevMainNavPrevMain
NavigatePrevSelectedNavPrevSelected
NavigatePrevUnreadNavPrevUnread
ReloadWindowRefreshWindow
ToolsRunBackgroundMacrosRunScheduledAgents
ToolsRunMacroRunAgent
ViewChangeSwitchView
ViewSwitchFormSwitchForm

@If function

@If executes one statement or another depending on whether a logical value is True or False:

@If(LogicalValue; TrueStatement; FalseStatement)

@Do function

@Do executes a number of statements in sequence and can be used as an execution path within an @If function:

@If(LogicalValue; @Do(TrueStatement1; TrueStatement2); FalseStatement)

Any @Command functions within an @Do function are executed in order after all other @functions, both within and without the @Do function, are executed.

@Return function

@Return stops execution of the formula:

@If(LogicalValue; @Return(""); "")