Tutorial

What are Lotus Notes Formula language functions and commands?

The following is tip #6 from "A Formula language for Lotus Notes introduction -- 7 tips in 7 minutes," excerpted from Chapter 5 of the book Lotus Notes Developer's Toolbox, published by IBM Publishing.

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)
@DeleteDocument agents
@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
@DocMark agents
@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
@IsCategory Column formulas
@IsDocBeingLoaded Forms and fields
@IsDocBeingMailed Buttons, hotspots and fields
@IsDocBeingRecalculated Buttons, hotspots and fields
@IsDocBeingSaved Buttons, hotspots and fields
@IsExpandable Column formulas
@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
@Success Validation formulas
@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.

Command Description Example
FileSave Saves the document currently displayed in the Lotus Notes client. Syntax:
@Command ( [FileSave] );
@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
@Command
([EditDocument]; 1)
CloseWindow Closes the document currently open in the Lotus Notes client. Syntax:
@Command ( [CLoseWindow] );
@Command
([CloseWindow]; 1)
Compose Creates a new document based on a specified form. Syntax:
@Command ([Compose] form );
form -- An existing form in the database
@Command
([Compose] "NewEmployee");
EditGoto-Field Places the cursor in the specified field on the document. Syntax:
@Command ([EditGotoField]; fieldname );
fieldname -- Name of a field on a form
@Command
([EditGotoField] "Title");


A Formula language for Lotus Notes introduction

 Home: 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

An Introduction to Formula Language 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.

This was first published in March 2007

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: