You are here: Pricing > Formula Management > Creating a Formula

Creating a Formula

OVERVIEW

Formulas can be in the main navigation menu for each Commerce Process. You can create formulas, using a drag & drop visual editor, that will set commerce attribute values. You will be able to set both main-document and sub-document level attributes. The use of formula management should reduce the need to use BML scripting.

ADMINISTRATION

ClosedCreating a Basic Formula

Standard Use Case: You need to set the values of the Extended Price, which is based on Net Price and Quantity.

  1. Navigate from: Admin Home Page > Process Definition Quick Links > Select a Process > Click Formulas
  2. Search for Extended Price in the Attribute Filter in the left panel.

    When you hover over an attribute, you will see the variable name and the data type.

  3. Drag & drop the Extended Price into the green Add Attribute bar under the Attribute Name.

    The Attribute Name will display as the variable name, not the label name.

    Next, you need to populate the formula bar. Here we are using main-document attributes. In this example, Extended Price = Net Price * Quantity

  4. Drag & drop the Net Price attribute into the formula bar.

  5. Type the multiplication operator * into the formula bar.

  6. Drag & drop the Quantity attribute into the formula bar.

  7. Click the icon to add the formula to the formula list.


ClosedCreating a Formula Using Functions

  1. Navigate from: Admin Home Page > Process Definition Quick Links > Select a Process > Click Formulas
  2. Search for Net Price in the Attribute Filter in the left panel.

    When you hover over an attribute, you will see the variable name and the data type.

  3. Drag & Drop the Net Price into the green Add Attribute bar under the Attribute Name.

    The Attribute Name will display as the variable name, not the label name.

  4. Collapse the Attributes section and open the Functions section, in the left panel.

  5. Drag & drop the if function into the formula bar.

    Once the if function has been placed into the formula bar, the if/else condition window pops up.

    When you hover over a function, you will see the required inputs and return.

  6. Populate the Condition. In this case, we want the Net Price to be calculated if %/Amt = Amt.

    Drag & drop is not available in the pop-up windows, so you will need to begin typing the label or variable name.

  7. Populate the True Value dialog box.

    This is the formula that will run if the condition is met. In this case, the True Value is List Price - Discount.

  8. Populate the False Value.

    This is the formula that will run if the condition is NOT met.

    In this case, the False Value is Line Price - (Line Price*Discount)/100.

  9. Click Save.
  10. Click the icon to add the formula to the formula list.

    When the Net Price formula is complete, it will appear in the formula list.


ClosedFormulas in Reconfiguration Scenarios

The Reconfigure action is split into one parent (Reconfigure) and one sub-action (Reconfigure Inbound). This eliminates the need for conditionals to segregate logic.



NOTES

RELATED TOPICS

Related Topics Link IconSee Also