Info

This scenario shows how to configure Costs and Margins for Monthly Recurring Charge and One Time Charge using SFIX.

Configure New Custom Fields on ‘QuoteLineItem’.

  1. Go to Setup, click Object Manager and search for ‘Quote Line Item’

  2. Create MonthlyRecurringChargeMarginTotal__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: Monthly Recurring Charge Margin Total
    • Field Name: MonthlyRecurringChargeMarginTotal
    • Length: 16 and Decimal Places: 2
  3. Configure field-level security, page layout, and save.

  4. Create OneTimeChargeMarginTotal__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: One Time Charge Margin Total
    • Field Name: OneTimeChargeMarginTotal
    • Length: 16 and Decimal Places: 2
  5. Configure field-level security, page layout, and save.

  6. Create EffectiveMonthlyRecurringCharge__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: Effective Monthly Recurring Charge
    • Field Name: EffectiveMonthlyRecurringCharge
    • Length: 16 and Decimal Places: 2
  7. Configure field-level security, page layout, and save.

  8. Create EffectiveOneTimeCharge__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: Effective One Time Charge
    • Field Name: EffectiveOneTimeCharge
    • Length: 16 and Decimal Places: 2
  9. Configure field-level security, page layout, and save.

Configure Custom Pricing Variables

  1. Click the App Launcher and navigate to the Vlocity Product Console.

  2. Create ‘Recurring Monthly Margin Total’ pricing variable with the following required values:

    General Properties Facet

    • Name: Recurring Monthly Margin Total
    • Code: REC_MNTH_MARGIN_TOTAL
    • Active: true
    • Charge Type: Recurring
    • Currency Type: Currency
    • Frequency: Monthly
    • Sub-Type: Standard
    • Type: Price
    • Value Type: Calculated
    • Scope: Line
    • Aggregation: Unit
    • Click Save Pricing Variable Binding
    • Name: Recurring Monthly Margin Total - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: MonthlyRecurringChargeMarginTotal__c
    • Click Save
  3. Create Effective Recurring Monthly Price pricing variable with the following required values:

    General Properties Facet

    • Name: Effective Recurring Monthly Price
    • Code: EFF_REC_MNTH_PRC
    • Active: true
    • Charge Type: Recurring
    • Currency Type: Currency
    • Frequency: Monthly
    • Sub-Type: Standard
    • Type: Price
    • Value Type: Calculated
    • Scope: Line
    • Aggregation: Unit
    • Click Save Pricing Variable Binding
    • Name: Effective Recurring Monthly Price - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: EffectiveMonthlyRecurringCharge__c
    • Click Save
  4. Create Recurring Monthly Std Cost Total pricing variable with the following required values:

    General Properties Facet

    • Name: Recurring Monthly Std Cost Total
    • Code: REC_MNTH_STD_CST_TOTAL
    • Active: true
    • Charge Type: Recurring
    • Currency Type: Currency
    • Frequency: Monthly
    • Sub-Type: Standard
    • Type: Cost
    • Value Type: Calculated
    • Click Save Pricing Variable Binding (Note: Here, we are binding this custom pricing variable with an OOTB QLI field.)
    • Name: Recurring Monthly Std Cost Total - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: vlocity_cmt__RecurringCostTotal__c
    • Click Save
  5. Create One Time Charge Margin Total pricing variable with the following required values:

    General Properties

    • Name: One Time Charge Margin Total
    • Code: OT_MARGIN_TOTAL
    • Active: true
    • Charge Type: One-time
    • Currency Type: Currency
    • Sub-Type: Standard
    • Type: Price
    • Value Type: Calculated
    • Scope: Line
    • Aggregation: Unit Pricing Variable Binding
    • Name: One Time Charge Margin Total - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: OneTimeChargeMarginTotal__c
    • Click Save
  6. Create Effective One Time Price pricing variable with the following required values:

    General Properties

    • Name: Effective One Time Price
    • Code: EFF_OT_PRC
    • Active: true
    • Charge Type: One-time
    • Currency Type: Currency
    • Sub-Type: Standard
    • Type: Price
    • Value Type: Calculated
    • Scope: Line
    • Aggregation: Unit
    • Click Save Pricing Variable Binding
    • Name: Effective One Time Price - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: EffectiveOneTimeCharge__c
    • Click Save
  7. Create One Time Std Cost Total pricing variable with the following required values:

    General Properties

    • Name: One Time Std Cost Total
    • Code: OT_STD_CST_TOTAL
    • Active: true
    • Charge Type: One-time
    • Currency Type: Currency
    • Sub-Type: Standard
    • Type: Cost
    • Value Type: Calculated Pricing Variable Binding (Note: Here, we are binding this custom pricing variable with an OOTB QLI field.)
    • Name: One Time Std Cost Total - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: vlocity_cmt__OneTimeCostTotal__c
    • Click Save

Configure OOTB Pricing Variables

Note: Check If the OOTB pricing variables REC_MNTH_STD_CST and OT_STD_CST don’t already exist, configure them; otherwise, use the existing ones.

  1. Click the App Launcher and navigate to the Vlocity Product Console.

  2. Create Recurring Monthly Std Cost pricing variable with the following required values:

    General Properties Facet

    • Name: Recurring Monthly Std Cost
    • Code: REC_MNTH_STD_CST
    • Active: true
    • Charge Type: Recurring
    • Currency Type: Currency
    • Frequency: Monthly
    • Sub-Type: Standard
    • Type: Cost
    • Value Type: Pricing Element
    • Scope: Line
    • Aggregation: Unit
    • Click Save Pricing Variable Binding
    • Name: Recurring Monthly Std Cost - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: vlocity_cmt__RecurringCost__c
    • Click Save
  3. Create One Time Std Cost pricing variable with the following required values:

    General Properties

    • Name: One Time Std Cost
    • Code: OT_STD_CST
    • Active: true
    • Charge Type: One-time
    • Currency Type: Currency
    • Sub-Type: Standard
    • Type: Cost
    • Value Type: Pricing Element
    • Scope: Line
    • Aggregation: Unit
    • Click Save Pricing Variable Binding
    • Name: One Time Std Cost - QuoteLineItem
    • Destination SObject Type: QuoteLineItem
    • Destination Field API Name: vlocity_cmt__OneTimeCost__c
    • Click Save

Configure Pricing Plan

  1. Click App Launcher and navigate to the Vlocity Product Console.
  2. Search for Default Pricing Plan, select Pricing Plan Steps facet, and click on New Item to add a new pricing plan.

  3. Configure Constants pricing plan step with the following details:
    • Name: Constants
    • Implementation Name: SfixWrapper
    • Method Name: DeclareConstants
    • Sequence: 62.1
    • Active: true
    • Parameters:
      • HUNDRED:100.0
    • Click Save
  4. Configure Rollup Cost Init pricing plan step with the following details:
    • Name: Rollup Cost Init
    • Implementation Name: SfixWrapper
    • Method Name: PricingVariableCalculation
    • Sequence: 62.2
    • Active: true
    • Parameters: Add the following values:
      • OT_STD_CST_TOTAL: OT_STD_CST
      • EFF_OT_PRC: OT_STD_PRC
      • REC_MNTH_STD_CST_TOTAL: REC_MNTH_STD_CST
      • EFF_REC_MNTH_PRC: REC_MNTH_STD_PRC
    • Click Done and Save.
  5. Configure Rollup Cost pricing plan step with the following details:
    • Name: Rollup Cost
    • Implementation Name: SfixWrapper
    • Method Name: RollupPricingVariableCalculation
    • Sequence: 62.3
    • Active: true
    • Parameters: Add the following values:
      • OT_STD_CST_TOTAL: OT_STD_CST*LINE_QUANTITY
      • REC_MNTH_STD_CST_TOTAL: REC_MNTH_STD_CST*LINE_QUANTITY
      • EFF_OT_PRC: OT_STD_PRC*LINE_QUANTITY
      • EFF_REC_MNTH_PRC: REC_MNTH_STD_PRC*LINE_QUANTITY
    • Click Done and Save.
  6. Configure Calculate Margins Totals pricing plan step with following details:
    • Name: Calculate Margins Totals
    • Implementation Name: SfixWrapper
    • Method Name: PricingVariableCalculation
    • Sequence: 62.4
    • Active: true
    • Parameters: Add the following values
      • OT_MARGIN_TOTAL: ((EFF_OT_PRC - OT_STD_CST_TOTAL)/OT_STD_CST_TOTAL)*HUNDRED
      • REC_MNTH_MARGIN_TOTAL: ((EFF_REC_MNTH_PRC - REC_MNTH_STD_CST_TOTAL)/REC_MNTH_STD_CST_TOTAL)*HUNDRED
    • Click Done and Save.

Note: The sequence of these pricing plan steps must be below all the pricing modifications/Adjustments like ‘Context Discounts’, ‘Offer Adjustments’, ‘Promotion Adjustments’ and ‘Charge Manual Adjustments’. In this example, we took 62 as a sequence number, assuming OOTB ‘Apply Charge Manual Adjustments’ is at sequence number 60.

Configure Pricing Elements

  1. Click the App Launcher and navigate to the Vlocity Product Console.
  2. Look up the price list, navigate to the ‘Pricing Element’ facet, select the ‘Costs’ tab, and then ‘New’.

  3. Configure ‘Monthly Recurring’ Cost Pricing Element with the following details:
    • Charge Type: Recurring
    • Frequency: Monthly
    • Sub Type: Standard Search
    • Select a Pricing Variable: Recurring Monthly Std Cost
    • Name: MRC_COST_20.00-USD (Follow any naming convention with the cost you want to assign.)
    • Code: PE_MRC_COST_20.00-USD (Follow any naming convention with the cost you want to assign.)
    • Display Text: $20
    • Cost: 20
    • Currency Code: USD (Select your own currency code.)
    • Effective From: 1/1/2021 (should be a past date)
    • Active: true
    • Click Save
  4. Configure the ‘One Time’ Cost Pricing Element with the following details:
    • Charge Type: One-time
    • Sub Type: Standard Search
    • Select a Pricing Variable: One Time Std Cost
    • Name: OT_COST_10.00-USD (Follow any naming convention with the cost you want to assign.)
    • Code: PE_OT_COST_10.00-USD (Follow any naming convention with the cost you want to assign.)
    • Display Text: $10
    • Cost: 10
    • Currency Code: USD (Select your own currency code.)
    • Effective From: 1/1/2021 (should be a past date)
    • Active: true
    • Click Save

Configure EPC

  1. Click the App Launcher and navigate to the Vlocity Product Console.
  2. Look up the product for which you wish to see the Cost and Margin feature.
  3. Go to Pricing, then to ‘Costs’ tab and click ‘New’.

  4. Under ‘Price List Entry’ configure the following details:
    • Price List: {Search and select the price list for which you have configured the above pricing elements. }
    • Display Text: $20
    • Charge Type: Recurring
    • Frequency: Monthly
    • Sub-Type: Standard
    • Selected Pricing Variable: Recurring Monthly Std Cost
    • Select a Pricing Element: MRC_COST_20.00-USD
    • Effective From: 1/1/2021 (should be a past date)
    • Active: true
    • Save
  5. Under ‘Price List Entry’, configure the following details:
    • Price List: { Search and select the price list for which you have configured the above pricing elements }
    • Display Text: $20
    • Charge Type: One-time
    • Sub-Type: Standard
    • Selected Pricing Variable: One Time Std Cost
    • Select a Pricing Element: OT_COST_10.00-USD
    • Effective From: 1/1/2021 (should be a past date)
    • Active: true
    • Save

Test

  1. Navigate to Setup, search ‘Platform Cache’ and clear CPQPartition.
  2. Open a CPQ cart and run pricing (eg. add to the cart or change quantity). Please note that refreshing the screen does not run pricing, and your new field would not be populated.
  3. Using the Developer Console or Salesforce Inspector, check for repriced line items and look for the values in the following fields:
    • MRC Fields: vlocity_cmt__RecurringCharge__c, vlocity_cmt__RecurringTotal__c, EffectiveMonthlyRecurringCharge__c, vlocity_cmt__RecurringCost__c, vlocity_cmt__RecurringCostTotal__c, MonthlyRecurringChargeMarginTotal__c.
    • OTC Fields: vlocity_cmt__OneTimeCharge__c, vlocity_cmt__OneTimeTotal__c, EffectiveOneTimeCharge__c, vlocity_cmt__OneTimeCost__c, vlocity_cmt__OneTimeCostTotal__c, OneTimeChargeMarginTotal__c

If the values populated in the above-mentioned fields are correct, congratulations! You have successfully configured a new feature using SFIX!