Installments with Down Payment
Info
This scenario shows how to configure Installments with Down Payment using SFIX.
Configure New Custom Fields on ‘QuoteLineItem’.
- Go to Setup, click Object Manager and search
Quote Line Item
- Create
OneTimeFinalCharge__c
forQuoteLineItem
.- Data Type: Currency
- Field Label: One Time Final Charge
- Field Name: OneTimeFinalCharge
- Length: 16 and Decimal Places: 2
- Configure field-level security, page layout, and save.
- Create
RecurringFinalCharge__c
forQuoteLineItem
.- Data Type: Currency
- Field Label: Recurring Final Charge
- Field Name: RecurringFinalCharge
- Length: 16 and Decimal Places: 2
- Configure field-level security, page layout, and save.
- Create
NumberOfInstallments__c
forQuoteLineItem
.- Data Type: Text
- Field Label: Number of Installments
- Field Name: NumberOfInstallments
- Length: 5
- Configure field-level security, page layout, and save.
- Create
OneTimeDownpayment__c
forQuoteLineItem
.- Data Type: Currency
- Field Label: One Time Downpayment
- Field Name: OneTimeDownpayment
- Length: 16 and Decimal Places: 2
- Configure field-level security, page layout, and save.
Configure Custom Pricing Variables
- Click the App Launcher and navigate to the Vlocity Product Console.
- 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
- General Properties Facet
- 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
- General Properties Facet
- 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
- General Properties Facet
- 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
- General Properties Facet
- 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
- General Properties Facet
Configure Picklist and Attribute
- Click App Launcher and navigate to the Vlocity Product Console.
- 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 New Item
- Click Save
- Similarly add Picklist Items for 24, 36, 48 etc.
- General Properties
- Click App Launcher and navigate to the Vlocity Product Console.
- 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
- Click App Launcher and navigate to the Vlocity Product Console.
- Search for ‘Default Pricing Plan’, select ‘Pricing Plan Steps’ facet, and click on ‘New Item’ to add a new pricing plan.
- 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
- 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.
- 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
- Click the App Launcher and navigate to the Vlocity Product Console.
- Look up the price list, navigate to the ‘Pricing Element’ facet, select the ‘Charges’ tab, and then ‘New’.
- 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
- Click the App Launcher and navigate to the Vlocity Product Console.
- Look up the product for which you wish to see the Installments and Down Payment feature.
- Go to Pricing Facet, then to ‘Charges’ tab and click ‘New’.
- 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
- Go to Attributes and Fields Facet and click ‘Assign Attributes/Fields’
- Search for Attribute ‘Number of Installments’, mark the checkbox and click ‘Assign’.
Configure Vlocity Attribute Binding
- Create an Attribute Binding for your
ATTR_NUMBER_OF_INSTALLMENTS
attribute andNumberOfInstallments__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
- Click App Launcher, Navigate to CPQ Configuration Setup
- Click Add to configure
PricingVariablesAutoRollup
- Name: PricingVariablesAutoRollup
- Setup Value: OT_DWNPMNT
Test
- Navigate to Setup, search ‘Platform Cache’ and clear CPQPartition.
- Open a CPQ cart and add the product that you have configured above and assign value to ‘Number of Installments’ attribute.
- Optional: Override the Downpayment
- 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!