Formula language
The Formula language is a scripting language used by Lotus Notes. It is often referred to as @Formula language because many language elements start with the @-character. Here is an example of a selection formula:
SELECT @NoteId = "NT0050D26"
Development
It was created by Ray Ozzie during the early development of Lotus Notes. He borrowed the compiler and decompiler from the Lotus 1-2-3 spreadsheet, but unlike the spreadsheet language Formula Language was designed primarily for string and list processing, not numerical processing. It was originally a Functional programming language with unique text list-handling features inspired by Ray Ozzie's prior use of Icon and Lisp.The Formula language engine was rewritten by Damien Katz for Notes and Domino 6. New features were added to the language, such as looping and dynamic execution, and performance was improved.
Structure
The Formula language has two parts:@Functions for calculations and simple logic@Commands for performing actions in the user interface@Functions can be used in several places throughout Lotus Notes. The most important uses are:
- to select documents to show to the user in a view or to select documents for further processing. In this case, the formula will evaluate to a 'true' or 'false' value for each document.
- to provide default values for fields, to transform the data entered by the user and to validate this data.
- to get a list of values from a Notes database or even from a relational database. This may be used to provide a user with a list of values to choose from.
- to process a set of documents. The formula is placed in an agent, a program or macro that can be started by a user or by the Notes server according to a schedule. When the agent is triggered, the formula executes for each selected document. This is an efficient way to change many documents, if the logic is not too complicated. In case of complicated changes, LotusScript is used.
- opening a Notes database
- creating an e-mail
- putting the cursor in a specific data-entry field
- closing a window
- starting an agent