You are here:
Reprice an Asset to Reflect a Context Rule Condition for an Account
You can reprice an asset to reflect a context rule condition for an account.
- Navigate to the Vlocity Product Console.
- Next to Product in the Product Management area, click the search icon.
- In the Search Product… dialog box, enter a product name, for example, Blast!, and click the search icon.
- Select the Blast! Pro Internet product and click the Pricing facet.
- Notice the pricing for both price list entries. For example, there may be a $20 RM price list with a context rule attached to the price list entry giving Platinum account customers a reduced price on the product.
- Navigate to the Accounts tab.
- Change the List Views to All Accounts.
- Select an account, for example, Acme.
- Click the DETAILS tab and notice how the SLA is set, for example, to Platinum.
- From the Lightning App Launcher, select Assets to open in a new tab.
- Change the List Views to All Assets.
- Select your product, for example, Blast! Pro Internet for Acme.
- On the DETAILS tab, notice the Recurring Charge for the asset is, for example, $20 according to the context rule for platinum accounts.
- Navigate back to the open browser tab for Acme.
- Click the Edit icon to change the SLA to, for example, Gold.
- Click Save.
-
From the URL, copy the Account ID from after the Account/ and before
/view and paste it to a text editor. You need this ID for the Apex code for
repricing accounts.
For example:
Secure | https://na57.lightning.force.com/lightning/r/Account/0010b00002BZo10AAD/view - Navigate to the Setup icon and select Developer Console.
- From the Developer Console, click Debug > Open Execute Anonymous Window.
-
Copy the following Apex code and paste it in the Enter Apex
Code box from the Developer Console.
List a = [SELECT Id FROM Account WHERE Id = '0011I00000DBYUK']; Map repricingInput = new Map {'objectList' > a}; Map repricingOutput = new Map(); Map repricingOptions = new Map(); vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance(); voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions); - In line 1, replace the Account ID currently in the code with the Account ID copied from the customer's account.
- Select the code and click Execute Highlighted.
- Verify the status is successful in the logs.
- Navigate back to the open Asset browser tab.
- Refresh the browser page.
- Notice the recurring charge for the asset has changed, for example, to $25 according to the price list entry for all customers other than Platinum.

