What are Formula language functions?
Formula Language can be divided into two groupings -- @Functions and @Commands.These groupings comprise Formula Language and are used to create formulas.
Functions are used to return a value and can be placed anywhere within a formula. Although most functions simply return a value, some functions interact with users or trigger other actions to occur. For example, the @Prompt and @PickList functions can be used to request input from the user.
As you gain experience with Formula Language, you'll find that most formulas are built using functions. However, some functions can only be used in specific design objects. The following table lists some of the restricted functions and describes where they can be used.
|Restricted function||Design objects that can use this function|
|@All||Replication formulas, agents and view selection formulas|
|@AllChildren||Replication formulas, and view selection formulas|
|@AllDescendants||Replication formulas, and view selection formulas|
|@Command||Toolbar buttons, manual agents, and action hotspots|
|@DBColumn||Toolbar buttons, actions, hotspots, fields and agent(except mail)|
|@DBLookup||Toolbar buttons, actions, hotspots, fields and agent(except mail)|
|@DeleteField||agents and fields|
|@DocChildren||Column formulas and window title formulas|
|@DBocDescendants||Column formulas and window title formulas|
|@DocLevel||Column formulas and window title formulas|
|@DocNumber||Column formulas and window title formulas|
|@DocParentNumber||Column formulas and window title formulas|
|@DocSiblings||Column formulas and window title formulas|
|@Failure||Field validation formulas|
|Environment||All formulas with the exception of popup hotspots|
|@Environment||All formulas with the exception of popup hotspots|
|FIELD||Toolbar buttons, actions, hotspots, fields and fields|
|@IsDocBeingLoaded||Forms and fields|
|@IsDocBeingMailed||Buttons, hotspots and fields|
|@IsDocBeingRecalculated||Buttons, hotspots and fields|
|@IsDocBeingSaved||Buttons, hotspots and fields|
|@IsNewDoc||Toolbar buttons, window title formulas, forms and fields|
|@MailSend||Toolbar buttons, agents, action hotspots and fields|
|@PickList||Toolbar Buttons, manual agents, action hotspots and fields|
|@Platform||Toolbar buttons, manual agents, hotspots, view design (with the exception of selection and column formulas), forms and fields|
|@Prompt||Toolbar buttons, manual agents, action hotspots and fields|
|@Responses||Window title formulas and fields|
|@Return||Toolbar buttons, agents, hotspots and fields|
|Select||Replication formulas, agents and view selection formulas|
|@SetDocField||Toolbar buttons, agents, action hotspots and fields|
|@SetEnvironment||All formulas with the exception of popup hotspots|
|@SetField||Toolbar buttons, agents, action hotspots and fields|
|@Unavailable||Agents, views and action buttons|
|@ViewTitle||Agents, action hotspots and buttons|
Note: A select number of functions can be called from LotusScript or have equivalents in LotusScript. Functions are sometimes called from LotusScript to simplify the code instructions. In other words, a single @Function can often replace multiple LotusScript code. In other cases, there are equivalent functions already included in the LotusScript language.
What are Formula language commands?
Commands are used to perform an action related to the application interface. For the most part, commands mimic menu options and tend to be used primarily in action buttons, hotspots, agents, and events. For example, commands can be used to
- Compose a new form
- Edit, save, or close a form
- Jump to a field and insert text
- Attach a file
- Send an email
- Open a database help document
Note: The following table represents some of the most frequently used commands. In most cases, these commands would be placed in an action button for a given form.
|FileSave||Saves the document currently displayed in the Lotus Notes client. Syntax:
@Command ( [FileSave] );
|Edit document||Toggles between edit and read mode for the currently opened document. Optionally, if you set the edit mode to 1, the document only goes to edit mode. If the mode is set to 0, the document goes to read mode. Syntax:
@Command ([EditDocument] mode; pane)
mode -- Set to 1 for edit, 0 for readonly
pane -- Set to 1 to display in preview pane
|CloseWindow||Closes the document currently open in the Lotus Notes client. Syntax:
@Command ( [CLoseWindow] );
|Compose||Creates a new document based on a specified form. Syntax:
@Command ([Compose] form );
form -- An existing form in the database
|EditGoto-Field||Places the cursor in the specified field on the document. Syntax:
@Command ([EditGotoField]; fieldname );
fieldname -- Name of a field on a form
A Formula language for Lotus Notes introduction
Tip 1: What is Lotus Formula Language?
Tip 2: Working with variables in Formula language for Lotus Notes
Tip 3: Lotus Notes Formula language keywords
Tip 4: Working with operators in Formula language for Lotus Notes
Tip 5: Lotus Notes Formula language general syntax rules
Tip 6: What are Lotus Notes Formula language functions and commands?
Tip 7: Working with text strings in Formula language for Lotus Notes
|This chapter excerpt from Lotus Notes Developer's Toolbox, by Mark Elliott, is printed with permission from IBM Publishing, Copyright 2006.
Click here for the chapter download or purchase the book here.