Skip to content

VoltFormula tutorial

This tutorial shows you how to use VoltFormula in Volt Iris to convert formulas from OpenFormula and NotesFormula into Volt MX Go Rosetta JavaScript. This feature in Volt Iris allows you to enter into source OpenFormula link image and Notes Formula Language link image and have it translated automatically into JavaScript code.

Before you begin

Launch Volt Iris

  1. Open Volt Iris. When the Sign-in dialog opens, close it.

    Note

    If you have already configured the login settings while performing the other tutorials, enter your email and password for Volt Foundry on the Sign in to your account page and click Sign In. You don't need to execute the steps below for configuring the login settings and logging in.

  2. Configure the login settings.

    1. Go to Preferences.

      For Windows, select EditPreferences.

      For Mac, depending on your macOS, select Volt IrisPreferences or Settings.

    2. In the Volt Iris Preferences dialog, click Volt Foundry.

      Preferences

    3. On the Volt Foundry tab, enter your Foundry URL in the Foundry URL text box, and then click Validate.

      You should see the “Validation Successful” message at the top of the dialog.

    4. Click Done.

  3. Log in to Volt Iris.

    1. Click Login on the upper right corner of the Volt Iris screen.
    2. Enter your email and password for Volt Foundry on the Sign in to your account page.
    3. Click Sign In. Your username appears next to the profile icon.

Open VoltFormula using the Action Editor

  1. On the Project tab, find and expand the Forms directory.

    Info

    If you cannot see the Project tab, click the Design tab beside the Storyboard tab.

  2. Select a form under the Forms directory. The selected form opens.

  3. Drag a widget or component to the form.
  4. Right-click the widget and select an action from the menu.

    The example image shows the Button widget added to the form and the onClick action selected from the menu.

    Selecting action from menu

    The Action Editor opens and creates an action sequence for you to configure.

  5. On the left side of the Action Editor, click Add Formula under Formula to add it to the action sequence and open the Formula Editor on the right side of the Action Editor.

    Action Editor

Translate OpenFormula and Notes Formula into JavaScript

  1. On the Action Editor, enter a valid formula in the Formula Language window of the Formula Editor.

    Tip

    • Enter a Notes Formula by starting with the @ character or enter an OpenFormula by starting with the = character.
    • IntelliSense will provide formula suggestions and corresponding formula descriptions, examples, and details as you enter your formula in the Formula Language window of the Formula Editor.
    • You can click Samples to open the Formula Samples dialog that provides descriptions and sample snippets for Notes, OpenFormula, and Custom formula samples.

      Formula Sample

    • Click Results to open the Formula Results window below the Formula Language window and see the result of the entered formula.

    The formula you entered in the Formula Language window is automatically converted to JavaScript code and is viewable from the window on top of the Formula Language window.

    Action Editor

  2. Click Save.

Use VoltFormula in a Controller module

Add formula in a controller

  1. On the Project tab, find and expand the Controllers directory.
  2. Select a controller under the Controllers directory. The selected controller opens.
  3. Right-click the code window and select Add Code from Formula.

    Controller

    The Formula Language window appears.

    Controller

  4. Enter a valid formula in the Formula Language window

    Tip

    • Enter a Notes Formula by starting with the @ character or enter an OpenFormula by starting with the = character.
    • IntelliSense will provide formula suggestions and corresponding formula descriptions, examples, and details as you enter your formula in the Formula Language window.
    • You can click Samples to open the Formula Samples dialog that provides descriptions and sample snippets for Notes, Open Formula, and Custom API formula samples.

      Formula Sample

    • Click Formula Results to open the Formula Results window below the Formula Language window and see the result of the entered formula.

    The formula you entered in Formula Language window is automatically converted to JavaScript code and is viewable in the code window on top of the Formula Language window.

    The following example image shows a formula being entered in the Formula Language window and with IntelliSense providing suggestions.

    Controller

  5. Save your changes.

Edit formula in a controller

  1. On the Project tab, find and expand the Controllers directory.
  2. Select a controller under the Controllers directory. The selected controller opens.
  3. Right-click the existing code and select Edit Formula Code.

    Controller

    The Formula Language window appears.

  4. Edit the formula in the Formula Language window.

    Note

    • Make sure to follow the correct syntax.
    • You can add more than one line of code.
    • IntelliSense will provide formula suggestions and corresponding formula descriptions, examples, and details as you enter your formula in the Formula Language window.
  5. Save your changes.

Edit Rosetta JavaScript

  1. On the Project tab, find and expand the Controllers directory.
  2. Select a controller under the Controllers directory. The selected controller opens.

    The piece of rosetta autogenerated code from OpenFormula or Notes Formula is provided between comments as shown in the following image.

    Controller

  3. Edit or update the JavaScript code in the code window of the controller.

    Note

    Make sure you know the syntax for coding the rosetta JavaScript.

    IntelliSense provides suggestions as you edit or update the code as shown in the following image.

    Controller

  4. Save your changes.

Additional information