You are here:
Repricing Example
Assuming changes in market conditions, you can lower the price of a product starting on a certain date and make this new price available to any orders that are still pending and have not been submitted for fulfillment.
To accomplish this, create a new price list entry and set the end date of the existing price list entry. Once the price list entries are created and updated, run the repricing service to reflect the new pricing on existing orders to ensure customers can take advantage of this new pricing:
- Navigate to the Vlocity Product Console.
- Next to Product in the Product Management area, click the search icon.
- In the Search Product… dialog box, press the return or enter key to display the list of products.
- Click a product, such as 4G LTE Data Plan.
- Click the Pricing facet.
- Click New to create a new price list entry.
-
Enter the following data for the Price List Entry fields:
-
Price List: B2C Price List
-
Display Text: $24.9
-
Base Price: Activate
-
Charge Type: Recurring
-
Frequency: Monthly
-
Sub-Type: Standard
-
Type: Price
-
- Click Search and select Recurring Monthly Std Price.
- Select $24.99 RM for the Pricing Element.
- For Effective From, select today’s date, and click the Active checkbox.
- Click Save. A warning may indicate that you currently have two price list entries that overlap.
- Navigate to the Orders tab.
- Change the List Views to All Orders.
- Select the Adv Pricing Data Plan Order.
- In Actions, click Configure to invoke the Industries CPQ Cart.
- Notice the Recurring Charge is $34.99.
- Navigate to the Setup icon and select Developer Console.
- From the Developer Console, click Debug > Open Execute Anonymous Window.
-
The following Apex code will be used to reprice orders. Copy this code
and paste it in the Enter Apex Code box from the Developer Console.
List<Order> a = [SELECT Id FROM Order WHERE Status = 'Draft' AND EffectiveDate > 2018 - 01 - 19]; Map<String, Object> repricingInput = new Map<String, Object>{'objectList' => a}; Map<String, Object>; repricingOutput = new Map&<String, Object>(); Map<String, Object> repricingOptions = new Map<String, Object>(); vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance(); voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);Once invoked, the Apex code reprices all orders with an order status of Draft, and with the effective date you selected. For sample Apex code, refer to RepricingInterfaceRepricingInterface.
- Select the code and click Execute Highlighted.
- Navigate back to the tab where the 4G LTE Data Plan is in the cart for the Adv Pricing Data Plan Order.
- Refresh the browser page.
- Notice the Recurring Charge is now $24.99 from the new price list entry.

