Info

This scenario shows how to configure Installments with Down Payment using SFIX.

Configure New Custom Fields on ‘QuoteLineItem’.

  1. Go to Setup, click Object Manager and search Quote Line Item
  2. Create OneTimeFinalCharge__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: One Time Final Charge
    • Field Name: OneTimeFinalCharge
    • Length: 16 and Decimal Places: 2
  3. Configure field-level security, page layout, and save.
  4. Create RecurringFinalCharge__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: Recurring Final Charge
    • Field Name: RecurringFinalCharge
    • Length: 16 and Decimal Places: 2
  5. Configure field-level security, page layout, and save.
  6. Create NumberOfInstallments__c for QuoteLineItem.
    • Data Type: Text
    • Field Label: Number of Installments
    • Field Name: NumberOfInstallments
    • Length: 5
  7. Configure field-level security, page layout, and save.
  8. Create OneTimeDownpayment__c for QuoteLineItem.
    • Data Type: Currency
    • Field Label: One Time Downpayment
    • Field Name: OneTimeDownpayment
    • 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 One Time Final Price pricing variable with the following required values:
    • General Properties Facet
      • Name: One Time Final Price
      • Code: OT_FINAL_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: One Time Final Price - QuoteLineItem
      • Destination SObject Type: QuoteLineItem
      • Destination Field API Name: OneTimeFinalCharge__c
      • Click Save
  3. Create Recurring Monthly Final Price pricing variable with the following required values:
    • General Properties Facet
      • Name: Recurring Monthly Final Price
      • Code: REC_MNTH_FINAL_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: Recurring Monthly Final Price - QuoteLineItem
      • Destination SObject Type: QuoteLineItem
      • Destination Field API Name: RecurringFinalCharge__c
      • Click Save
  4. Create One Time Downpayment pricing variable with the following required values:
    • General Properties Facet
      • Name: One Time Downpayment
      • Code: OT_DWNPMNT
      • 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: One Time Downpayment - QuoteLineItem
      • Destination SObject Type: QuoteLineItem
      • Destination Field API Name: OneTimeDownpayment__c
      • Click Save
  5. Create One Time Downpayment Adjustment Abs pricing variable with the following required values:
    • General Properties Facet
      • Name: One Time Downpayment Adjustment Abs
      • Code: OT_DWNPMNT_ADJ_ABS
      • Active: true
      • Charge Type: Adjustment
      • Currency Type: Currency
      • Sub-Type: Standard
      • Type: Price
      • Adjustment Method: Absolute
      • Value Type: Pricing Element
      • Scope: Line
      • Aggregation: Unit
      • Applies To Variable: One Time Downpayment
      • Click Save
  6. Create One Time Downpayment Adjustment Pct pricing variable with the following required values:
    • General Properties Facet
      • Name: One Time Downpayment Adjustment Pct
      • Code: OT_DWNPMNT_ADJ_PCT
      • Active: true
      • Charge Type: Adjustment
      • Currency Type: Currency
      • Sub-Type: Standard
      • Type: Price
      • Adjustment Method: Percent
      • Value Type: Pricing Element
      • Scope: Line
      • Aggregation: Unit
      • Applies To Variable: One Time Downpayment
      • Click Save

Configure Picklist and Attribute

  1. Click App Launcher and navigate to the Vlocity Product Console.
  2. Create a Picklist with the following details:
    • General Properties
      • Name: Number of Installments
      • Code: PKL_NUMBER_OF_INSTALLMENTS
      • Data Type: Number
      • Active: true
      • Effective From: 1/1/2021 (should be a past date)
    • Picklist Items
      • Click New Item
        • Number Value: 0
        • Label: None
        • Code: None
        • Sequence: 100
        • Effective From: 1/1/2021 (should be a past date)
      • Click New Item
        • Number Value: 12
        • Label: 12
        • Code: 12
        • Sequence: 20
        • Effective From: 1/1/2021 (should be a past date)
    • Click Save
    • Similarly add Picklist Items for 24, 36, 48 etc.
  3. Click App Launcher and navigate to the Vlocity Product Console.
  4. Create an attribute with the following details:
    • Name: Number of Installments
    • Code: ATTR_NUMBER_OF_INSTALLMENTS
    • Attribute Category: Generic Attributes
    • Value Type: Picklist
    • Picklist: Number of Installments
    • Display Sequence: 3
    • 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: 51
    • Active: true
    • Parameters: {“ZERO”:0}
    • Click Save
  4. Configure Store OTC And MRC pricing plan step with the following details:
    • Name: Store OTC And MRC
    • Implementation Name: SfixWrapper
    • Method Name: PricingVariableCalculation
    • Sequence: 61.1
    • Active: true
    • Parameters:
      • OT_FINAL_PRC: OT_STD_PRC
      • REC_MNTH_FINAL_PRC: REC_MNTH_STD_PRC
    • Click Done and Save.
  5. Configure Calculate Installments pricing plan step with the following details:
    • Name: Calculate Installments
    • Implementation Name: SfixWrapper
    • Method Name: PricingVariableCalculation
    • Sequence: 61.2
    • Active: true
    • Parameters:
      • REC_MNTH_STD_PRC: IF(NumberOfInstallments__c != ZERO,(OT_STD_PRC - OT_DWNPMNT)/NumberOfInstallments__c, REC_MNTH_STD_PRC)
      • OT_STD_PRC: IF(NumberOfInstallments__c != ZERO,OT_DWNPMNT,OT_STD_PRC)
    • 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 61 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 ‘Charges’ tab, and then ‘New’.
  3. Configure ‘Downpayment’ Charge Pricing Element with the following details:
    • Charge Type: One-time
    • Sub Type: Standard
    • Search & select a Pricing Variable: One Time Downpayment
    • Name: DWNPMNT_0.00-USD (Follow any naming convention with the charge you want to assign.)
    • Code: PE_DWNPMNT_0.00-USD (Follow any naming convention with the charge you want to assign.)
    • Display Text: $0.00
    • Charge: 0
    • Currency Code: USD (Select your own currency code.)
    • Effective From: 1/1/2021 (should be a past date)
    • Active: true
    • Click Save

Configure Product

  1. Click the App Launcher and navigate to the Vlocity Product Console.
  2. Look up the product for which you wish to see the Installments and Down Payment feature.
  3. Go to Pricing Facet, then to ‘Charges’ 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: $0.00
    • Charge Type: One-time
    • Sub-Type: Standard
    • Selected Pricing Variable: One Time Downpayment
    • Select a Pricing Element: DWNPMNT_0.00-USD
    • Effective From: 1/1/2021 (should be a past date)
    • Active: true
    • Click Save
  5. Go to Attributes and Fields Facet and click ‘Assign Attributes/Fields’
  6. Search for Attribute ‘Number of Installments’, mark the checkbox and click ‘Assign’.

Configure Vlocity Attribute Binding

  1. Create an Attribute Binding for your ATTR_NUMBER_OF_INSTALLMENTS attribute and NumberOfInstallments__c field with following details:
    • Attribute Binding Name: Installments
    • Field Name: NumberOfInstallments__c
    • Vlocity Attribute: Number of Installments
    • Object Class: QuoteLineItem

Configure CPQ Configuration Setup

  1. Click App Launcher, Navigate to CPQ Configuration Setup
  2. Click Add to configure PricingVariablesAutoRollup
    • Name: PricingVariablesAutoRollup
    • Setup Value: OT_DWNPMNT

Test

  1. Navigate to Setup, search ‘Platform Cache’ and clear CPQPartition.
  2. Open a CPQ cart and add the product that you have configured above and assign value to ‘Number of Installments’ attribute.
  3. Optional: Override the Downpayment
  4. Then using the Developer Console or Salesforce Inspector, check for repriced line items and look for the values in the following fields:

    OneTimeFinalCharge__c, RecurringFinalCharge__c, NumberOfInstallments__c, OneTimeDownpayment__c, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeCharge__c

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