Formulas for automation

Use formulas for shared and unshared actions, buttons, formula pop-ups, hotspots, events, specific infoboxes, and agents.

Using @command formulas with actions and hotspots

When an action or hotspot uses an @command formula, the formula works only when it runs in the appropriate context. Keep the following in mind:

  • A hotspot or action can process a field or an entire document, but not a selected area. When you point to the button to activate it, you lose the previous selection -- that is, the previous highlight disappears, and only the button is highlighted. To work around this, use the @command with parameters such as EditLeft or EditRight which move the focus within a document. Then when the user activates the hotspot or action, Notes® uses the formula to determine what is affected.
  • Formulas designed to edit a field don't work when the document is in Read mode. To work around this, use the @command([EditDocument]) to put a document in Edit mode.

Security features that affect automation formulas

Automated components with formulas run by users work only if users activate them in the correct context and have enough privileges to perform the automated task. For example, if a formula in a hotspot uses @SetField to change a field value, the hotspot doesn't work when the user activating it has only Reader access or the document is in read mode.

An automated component with formulas cannot usually complete unauthorized tasks on a database stored on a server because most users do not have privileges that allow them to run such tasks. However, in a local database where you have Manager privileges by default, an automated component with a formula could potentially change documents. If you are unfamiliar with the formulas associated with an automated component, review them first.

If the user's NOTES.INI file includes this statement


then any formula involving the following features is disabled:

  • @command
  • @PostedCommand
  • @DbCommand, @DbColumn, @DbLookup (only if it refers to a non-Notes database)
  • @MailSend
  • Dynamic Data Exchange (DDE) including all @DDE functions
  • Object Linking and Embedding (OLE)
  • Launching attached files

The user doesn't see a message, but the formula won't run.