Storing price
Info
This simple scenario shows how to configure saving regular price in a dedicated field, ie. before applying discounts or manual overrides
Configure New Custom Fields on QuoteLineItem and OrderItem
- Go to Setup and click Object Manager.
- Create
Regular Recurring ChargeforQuoteLineItemand ‘OrderItem’ objects.- Data Type: Currency
- Field Label: Regular Recurring Charge
- Field Name: RegularRecurringCharge
- 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
Recurring Monthly Regular Pricepricing variable with following required values:- General Properties Facet
- Name: Monthly Recurring Regular Price
- Code: REC_MNTH_REG_PRC
- Active: True
- Charge Type: One-time
- Sub-Type: Standard
- Type: Price
- Value Type: Pricing Element
- Scope: Line
- Aggregation: Unit
- Click Save
- Pricing Variable Bindings for QuoteLineItem
- Name: Recurring Monthly Regular Price - QuoteLineItem
- Destination SObject Type: QuoteLineItem
- Destination Field API Name: RegularRecurringCharge__c
- Pricing Variable Bindings for OrderItem
- Click New Pricing Variable Binding
- Name: Recurring Monthly Regular Price - OrderItem
- Destination SObject Type: OrderItem
- Destination Field API Name: RegularRecurringCharge__c
- Click Save
- General Properties Facet
Configure Pricing Plan
- Add new Pricing plan step to populate
REC_MNTH_REG_PRCpricing variable, make sure it fires afterInitialize Pricing Variablesand beforeApply Context Discounts(32 for out of the box pricing plan) or any other pricing plan step which affects the price- Implementation Name:
SfixWrapper - Method Name:
PricingVariableCalculation - Sequence: 32
- Implementation Name:
- Go to Vlocity CMT Administration > Maintenance Jobs and clean CPQ cache by clicking Start for CLEAR MANAGED PLATFORM CACHE
Test
- Open CPQ cart and run pricing (eg. add to cart) - 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__cpopulated - congratulations, you have successfully configured your frist new feature using SFIX!