Procedure Builder Tab

Procedure Builder tab is a convenient tool to set up a Pricing Procedure step by step, so you do not need to manually build the JSON query.

To use it, click the Procedure Builder button on the Pricing Procedure object:

procedure builder button

By default, Builder for Pricing Procedure 1.0 is opened. To open Builder for Pricing Procedure 2.0, click Move to Advance Version:

procedure builder 1 0
procedure builder 2 0
  • Procedure Builder for v 1.0

  • Procedure Builder for v 2.0

  1. Set up Pricing procedure settings:

  2. Click Save.

  1. Set up Pricing Procedure steps:

    • Procedure Step

      The Item type setting is missing in the resulting JSON itself, but it defines the JSON structure.
    • Set Value Step

    • Roll Up Step

    • Drill Down Step

    • SDK Step

      • Drag and drop steps with drag n drop icon to arrange them in your desired order.

      • Use Add Step and Delete Step buttons to make a desired number of steps.

      • For the Type field in the Value Settings, select:

        • String to select the price type

        • Number to enter the decimal value

        • Formula to set up formula settings:

          procedure builder 2 0 formula

          The MULTIPLY formula operator is displayed as multi in the JSON query.

          For each step, you can also set up Step Conditions. Useful notes:

    • Use OR, AND, + and Add Group buttons to set up condition groups:

      • You can add up to 3 subgroups for each group.

      • For the AND group type, its subgroup type is automatically set to OR and vice versa.

    • Click Delete group to delete condition group and 25 to delete condition string.

  2. Click Save.

Examples

Pricing Procedure 1.0

To generate JSON from the Workshop 2.2, do the following in the Procedure Builder for v 1.0:

pricing procedure v1 example

These settings will generate the following JSON:

{ "procedure": { "type":"SUM", "items": [ {"calculationType":"Promo" } ] }}

Pricing Procedure 2.0

To generate JSON from the Workshop 2.3, make the following settings in the Procedure Builder for v 2.0:

  1. Drill Down

    pricing procedure v2 example step1
  2. Procedure

    pricing procedure v2 example step2
    pricing procedure v2 example step2 condition
  3. Procedure

    pricing procedure v2 example step3
    pricing procedure v2 example step3 condition
  4. Set Value

    pricing procedure v2 example step4
    pricing procedure v2 example step4 condition
  5. Roll Up

    pricing procedure v2 example step5
  6. Set Value

    pricing procedure v2 example step6
  7. Roll Up

    pricing procedure v2 example step7
  8. Set Value

    pricing procedure v2 example step8
  9. Roll Up

    pricing procedure v2 example step9

These settings will generate the following JSON:

Click to view
{
  "version": 2,
  "steps": [
    {
      "type": "drillDown",
      "baseObject": "orders__OrderLineItem__c",
      "basePrice": "ManualDiscountPercent__c",
      "result": [
        {
          "resultObject": "orders__DeliveryLineItem__c",
          "resultPrice": "ManualDiscountPercent__c"
        }
      ]
    },
    {
      "type": "procedure",
      "basePrice": "$.listPrice",
      "resultPrice": "$.unitPrice",
      "condition": {
        "operator": "OR",
        "items": [
          {
            "field": "ManualDiscountPercent__c",
            "operator": "lessOrEqual",
            "value": 0
          },
          {
            "field": "ManualDiscountPercent__c",
            "operator": "equal",
            "value": null
          }

        ]
      },
      "procedure": {
        "type": "MULT",
        "round": "item",
        "roundTo": 4,
        "items": [
          {
            "calculationType": "ClientBased"
          },
          {
            "calculationType": "Promo"
          }
        ]
      }
    },
    {
      "type": "procedure",
      "basePrice": "$.listPrice",
      "resultPrice": "$.unitPrice",
      "condition": {
        "operator": "AND",
        "items": [
          {
            "field": "ManualDiscountPercent__c",
            "operator": "greater",
            "value": 0
          }
        ]
      },
      "procedure": {
        "type": "MULT",
        "round": "item",
        "roundTo": 4,
        "items": [
          {
            "calculationType": "manualdiscountpercent"
          }

        ]
      }
    },
    {
      "type": "setValue",
      "object": "orders__DeliveryLineItem__c",
      "resultPrice": "$.unitPrice",
      "condition": {
        "operator": "AND",
        "items": [
          {
            "field": "$.unitPrice",
            "operator": "less",
            "value": 0
          }
        ]
      },
      "value": 0
    },
    {
      "type": "rollUp",
      "baseObject": "orders__DeliveryLineItem__c",
      "basePrice": "$.unitPrice",
      "method": "copyEqual",
      "result": [
        {
          "resultObject": "orders__OrderLineItem__c",
          "resultPrice": "$.unitPrice"
        }
      ]
    },
    {
      "type": "setValue",
      "object": "orders__DeliveryLineItem__c",
      "resultPrice": "$.totalPrice",
      "value": {
        "operator": "multi",
        "items": [
          "$.unitPrice",
          "$.quantity"
        ]
      }
    },
    {
      "type": "rollUp",
      "baseObject": "orders__DeliveryLineItem__c",
      "basePrice": "$.totalPrice",
      "method": "sum",
      "result": [
        {
          "resultObject": "orders__Order__c",
          "resultPrice": "$.totalPrice"
        },
        {
          "resultObject": "orders__Delivery__c",
          "resultPrice": "$.totalPrice"
        },
        {
          "resultObject": "orders__OrderLineItem__c",
          "resultPrice": "$.totalPrice"
        }
      ]
    },
    {
      "type": "setValue",
      "object": "orders__DeliveryLineItem__c",
      "resultPrice": "$.totalDiscount",
      "value": {
        "operator": "multi",
        "items": [
          {
            "operator": "sum",
            "items": [
              "$.listPrice",
              "- $.unitPrice"
            ]
          },
          "$.quantity"
        ]
      }
    },
    {
      "type": "rollUp",
      "baseObject": "orders__DeliveryLineItem__c",
      "basePrice": "$.totalDiscount",
      "method": "sum",
      "result": [
        {
          "resultObject": "orders__Order__c",
          "resultPrice": "$.totalDiscount"
        },
        {
          "resultObject": "orders__Delivery__c",
          "resultPrice": "$.totalDiscount"
        },
        {
          "resultObject": "orders__OrderLineItem__c",
          "resultPrice": "$.totalDiscount"
        }
      ]
    }
  ]
}

See also:

``