Invoice from Order

Prev Next

Since an invoice is accompanied by one or more invoice lines, using a Process or Workflow is not enough to automate its creation. You need to use a flow that is the only one capable of fetching data from the child records of the object to be billed, e.g. Products ordered for Order.
Here we'll give you an example of the flow you need to reproduce to invoice an Order. You need to adapt it to your needs and environment.

Note: It is also possible to carry out specific APEX development to invoice an object.

Let's start by looking at the architecture of this flow:
We first retrieve data on the Order and Products ordered, then generate the Invoice and its Invoice Line Items.

  1. Start screen (optional if you're creating an automatically triggered flow): the user is asked if they wish to invoice this record.

  2. Get records: retrieve all the Products ordered on the Order.

  3. Get records: retrieve Order data.

  4. Create records : an Invoice is generated from data retrieved from the Order.

  5. Loop: we loop one by one over all the Products ordered, retrieved in step 2.

  6. Assignment: an Invoice Line Item is associated with each Product ordered.

  7. Assignment: Invoice Line Items are added together in a Record Collection variable.

  8. Create records: all Invoice Line Items are created from the data for Products ordered on the Invoice created in step 4.

  9. End screen: the user is notified of the successful completion of the process, and presented with a link to the Invoice record.

Here is the list of variables used:

  • Variables :

    • VarT_Invoice_ID

      • Type: text

      • Availability: for output

    • VarT_Order_ID

      • Type: text

      • Availability: for input

  • Record (Single) Variables :

    • VarR_Order

      • Object: Order

      • Availability: none

    • VarR_Invoice_Line_Item

      • Object: Invoice line item

      • Availability: none

    • VarR_Order_Item

      • Object: Product ordered

      • Availability: none

  • Record Collection Variables :

    • VarRC_Invoice_Line_Item

      • Object: Invoice line item

      • Availability: none

    • VarRC_Order_Item

      • Object: Product ordered

      • Availability: none

Here are some pictures of the various components:

1. Start screen

2. Retrieving information on ordered products

3. Retrieving information on orders

4. Invoice creation

5. Loop

6. Assigning ordered product values to an invoice line item

7. Compilation of Invoice Lines into a collection variable Invoice Line Item

8. Generating invoice line items

9. Success screen

Please note: this flow is provided as a guide, to assist you in a non-standard Frisbii configuration. As a result, any malfunctions are not covered by Frisbii, and you will not receive any assistance in setting up or correcting them outside a paid support contract.