Subsidies with totals
Info
This more complex scenario shows how to configure Subsidies, which includes Subsidies Total and Subsidies Rollup to parent QuoteLineItem or OrderItem.
Configure New Custom Fields on ‘QuoteLineItem’ and ‘OrderItem’
- Go to Setup and click Object Manager.
- Create
One Time Subsidy
forQuoteLineItem
andOrderItem
objects.- Data Type: Currency
- Field Label: One Time Subsidy
- Field Name: OneTimeSubsidy
- Length: 16 and Decimal Places: 2
- Configure Field Level Security and Page Layout and click save.
- Create
One Time Subsidy Total
forQuoteLineItem
andOrderItem
objects.- Data Type: Currency
- Field Label: One Time Subsidy Total
- Field Name: OneTimeSubsidyTotal
- Length: 16 and Decimal Places: 2
- Configure Field Level Security and Page Layout and click save.
Configure New Pricing Variables
- Click App Launcher and navigate to Vlocity Product Console.
- Create
One Time Charge Subsidy
pricing variable with following required values:- General Properties Facet
- Name: One Time Charge Subsidy
- Code: OT_SUBSIDY
- Active: True
- Charge Type: One-time
- Sub-Type: Standard
- Type: Price
- Value Type: Pricing Element
- Scope: Line
- Aggregation: Unit
- Pricing Variable Bindings for QuoteLineItem
- Name: One Time Charge Subsidy - QuoteLineItem
- Destination SObject Type: QuoteLineItem
- Destination Field API Name: OneTimeSubsidy__c
- Pricing Variable Bindings for OrderItem
- Click New Pricing Variable Binding
- Name: One Time Charge Subsidy - OrderItem
- Destination SObject Type: OrderItem
- Destination Field API Name: OneTimeSubsidy__c
- General Properties Facet
- Create
One Time Charge Subsidy Total
pricing variable with following required values:- General Properties
- Name: One Time Charge Subsidy Total
- Code: OT_SUBSIDY_TOTAL
- Active: True
- Charge Type: One-time
- Sub-Type: Standard
- Type: Price
- Value Type: Calculated
- Pricing Variable Bindings for QuoteLineItem
- Name: One Time Charge Subsidy - QuoteLineItem
- Destination SObject Type: QuoteLineItem
- Destination Field API Name: OneTimeSubsidyTotal__c
- Pricing Variable Bindings for OrderItem
- Click New Pricing Variable Binding
- Name: One Time Charge Subsidy - OrderItem
- Destination SObject Type: OrderItem
- Destination Field API Name: OneTimeSubsidyTotal__c
- General Properties
- Create
Rollup One Time Charge Subsidy Total
pricing variable with following required values:- General Properties
- Name: Rollup One Time Charge Subsidy Total
- Code: ROLLUP_OT_SUBSIDY_TOTAL
- Active: True
- Charge Type: One-time
- Sub-Type: Standard
- Type: Price
- Value Type: Calculated
- Scope: Rollup
- Applies To Variable: One Time Charge Subsidy Total
- General Properties
CPQ Configuration/Settings
- Click App Launcher, Navigate to ‘Interface Implementations’.
- Add a new Interface Implementation
- Interface Name: ‘DefaultPricingVariableCalcImplementaInterface’
- Active Implementation Class: ‘sfix.RollupPricingVariableImplementation’
- Description: ’SFIX’
- Save
- Click New to add ‘Interface Implementations Details’ in the Related tab
- Available Implementation: ‘sfix.RollupPricingVariableImplementation’
- Interface Name: ‘DefaultPricingVariableCalcImplementaInterface’
- Active: true
- Default: true
- Add a new Interface Implementation
- Click App Launcher, Navigate to ‘Vlocity CMT Administration’.
- Add a key value pair in CPQ Configuration Setup.
- Name: PricingVariablesAutoRollup and Setup Value: OT_SUBSIDY
- Name: SfixCachePartition and Setup Value: sfix.ExtendedAttributePartition
- Add a key value pair in CPQ Configuration Setup.
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 ‘Subsidy’ Charge Pricing Element with the following details:
- Charge Type: One-time
- Sub Type: Standard
- Search & select a Pricing Variable: One Time Charge Subsidy
- Name: SUBSIDY_10.00-USD (Follow any naming convention with the charge you want to assign.)
- Code: PE_SUBSIDY_10.00-USD (Follow any naming convention with the charge you want to assign.)
- Display Text: $10.00
- Charge: 10
- 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 subsidy 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: $10.00
- Charge Type: One-time
- Sub-Type: Standard
- Selected Pricing Variable: One Time Charge Subsidy
- Select a Pricing Element: SUBSIDY_10.00-USD
- Effective From: 1/1/2021 (should be a past date)
- Active: true
- Click Save
Test
- Open CPQ cart and run pricing (eg. add to cart or change Quantity) - please note that refreshing the screen does not run pricing and your new field would not be populated.
- Using Developer Console or Salesforce Inspector to check repriced line items - if you can see
RegularRecurringCharge__c
andOneTimeSubsidyTotal__c
with correct data populated - congratulations, you have successfully configured quite complex feature using SFIX!