Versions Compared

Key

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

Many customers use frevvo to build workflows such as Purchase Orders or Invoices that require a sequential number identifier. frevvo has a built-in Sequence Number generator that can be used to populate these numbers in your forms automatically.

You will start by created creating a Sequence Number. Then, use business rules to populate a control with that Sequence Number (and any associated formatting) at run time.

...

  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');
    }
    }

The first time the form runs, it will populate the initial sequence number:

...

For all subsequent times the form runs, it will populate the next incremented number each time (101, 102, 103, etc.).

...

FAQs

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

...