Configure the After Calculation Result
You can update or overwrite the calculation step, including all variables that are relevant to the calculation. This user exit is called after the calculation.
Required Editions
| Available in: Lightning Experience in Professional, Enterprise, and Unlimited Editions that have Consumer Goods Cloud enabled |
| User Permissions Needed | |
|---|---|
| To configure user exits: | CGCloud Business Admin OR CGCloud Retail Business Admin |
- From the App Launcher, find and select User exits.
- Click New
- From the Type dropdown list, select Configure After Calculation Result.
- Click Save.
- Click the Related tab, and then click New.
-
Enter the query.
Use multiple user exit content records to structure the code. For example, structure the content so that one record holds the return variable name and the start of the switch statement. Use another record to hold the logic for the different user exit IDs, and another record to return the result or variable.
Sort Order User Exit Content Description 1 var AffectedResults = {}; switch(UserExitId) {Declaring return variable and start of the switch statement
2 case "100_CalcResult_BasePrice_ext": if(Utils.isDefined(ProductAttributes[0].text1) && ProductAttributes[0].text1 === "Empower Cola 1,0 L PET"){ AffectedResults.currentConditionValue = 19.99; AffectedResults.currentCalculationBase = 20; AffectedResults.currentCalculationResult = AffectedResults.currentCalculationBase * AffectedResults.currentConditionValue; AffectedResults.currentTotal = AffectedResults.currentCalculationResult; } break;Logic that handles the user exit id “100_CalcResult_BasePrice_ext”” 3 } return AffectedResults;Closing the switch statement and returning the return variable - From the App Launcher, find and select Calculation Schemas.
- Select a calculation schema, and click Edit.
- In the Calculation Schema Steps section, select a calculation step to apply to this user exit. For example, the above user exit content is for case step 100.
- In the User Exit section, enter the user exit ID to apply the user exit to the calculation. For example, the user exit ID for case step 100 is 100_CalcResult_BasePrice_ext.
- Click Save.
Did this article solve your issue?
Let us know so we can improve!

