Skip to content

Formula language

The formula language is the oldest language in HCL Notes. It consists of @functions such as @If, @DbLookup and @Today and is used in fields, views, buttons and simple agents.

The formula language is the oldest language in HCL Notes. It has been there since version 1 in 1989 and consists of @functions that resemble formulas in a spreadsheet. The formula language is used in fields, views, buttons and simple agents. It is also called @Formula.

What is the formula language used for?

  • Field formulas: default values, calculations and validation, for example @If(Amount < 0; @Failure("Amount must be positive"); @Success).
  • Views: selection formulas that decide which documents are shown, and column formulas that decide what appears in each column.
  • Lookups with @DbLookup and @DbColumn, which fetch data from other views and databases.
  • Hide formulas that control what the user sees based on role or status.
  • Simple agents and buttons, such as changing status and sending mail.

Formula language or LotusScript?

The formula language is fast and compact, but it cannot loop, handle errors or call external systems. When the logic grows, you switch to LotusScript. A typical Notes application uses the formula language in forms and views and LotusScript in agents and buttons with a lot of logic.

Why does it matter in a migration?

A large part of a Notes application's business rules sits hidden in field formulas and hide formulas that nobody has documented. In a migration they must be found and translated to the new system. We have tools that extract all formulas from a database, so you can see what the application actually does.

Common questions

Is the formula language hard to learn?

No. If you know Excel formulas, you can learn most of it in a day. The hard part is understanding when the formulas run.

Do formulas work in Nomad and XPages?

Yes in Nomad. In XPages formulas can be called, but you typically use JavaScript.

What is @DbLookup, and why is it slow?

@DbLookup looks up a view. Used in every row of a view with 100,000 documents, the view becomes slow. It is one of the most common reasons Notes applications feel heavy.

Help

We optimise slow applications and document formulas before migration. See Notes development.

All terms in the glossary