Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Visual Rule Builder

    1. Set the Condition to a condition of your choice. In this example, I am using a trigger button named “ReadyToSubmit”.

    2. Set the Action to <control name> default to getNextSequenceNumber(“<SequenceNumberName”>)
      You may also use the concat() function around the sequence number function(s) in order to provide additional formatting.
      This example shows both functions in the Visual Rule Builder:

    3. Click Finish. Your rule looks like this:

  2. Rule Editor. You can use the javascript rule editor to create a rule like this which runs on the form.unload event for the first step of the flow, and sets the default value (sets a value only if the control was empty.)

    Code Block
    var an = _data.getParameter("flow.activity.name");
    if (form.unload && an === "Sales"){
    //Set the next sequence number only
    if (Boolean(PO.empty)) {
      PO.value = frevvo.getNextSequenceNumber('PurchaseOrderNumber');
    }
    //display the current sequence number with formatting
    if (Boolean(POFormatted.empty)) {
      POFormatted.value = 'PO-' + frevvo.getSequenceNumber('PurchaseOrderNumber');
    }
    }

At run-time, the form will populate the sequence number as defined in your rule:

...

FAQs

What happens if the sequence number is generated on two forms at the exact same time?

...