---
schema_version: "1"
id: 5058692a0f4164be96e3cd2429016eff18e3d9b9d157bf6f03a4ed1a6d21f98c
title: Configure the After Calculation Result
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_admin_task_after_calculation_result.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_admin_task_after_calculation_result.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 5e6ebf9c0f6287c15d4761298910f4ad9f2acd7a3fea687e045bb9ea9aa84f4c
description: 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.
products:
  - Consumer Goods
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience in <strong>Professional</strong>, <strong>Enterprise</strong>, and <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d72355e63">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d72355e63 ">To configure user exits:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d72355e63 ">
              <p>CGCloud Business Admin</p>
              <p style="margin-bottom:0;">OR</p>
              <p style="margin-bottom:0;">CGCloud Retail Business Admin </p>
            </td>

          </tr>
        </tbody>
      </table>

1. From the App Launcher, find and select **User exits**.
2. Click **New**
3. From the Type dropdown list, select **Configure After Calculation Result**.
4. Click **Save**.
5. Click the **Related** tab, and then click **New**.
6. 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.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <thead class="slds-text-title_caps ">
              <tr><th class="slds-cell-wrap" scope="col" id="d72355e150">Sort Order</th>
              <th class="slds-cell-wrap" scope="col" id="d72355e153">User Exit Content</th>
              <th class="slds-cell-wrap" scope="col" id="d72355e156">Description</th>
            </tr></thead>
            <tbody><tr class="">
              <td class="slds-cell-wrap" data-label="Sort Order" headers="d72355e150">1</td>
              <td class="slds-cell-wrap" data-label="User Exit Content" headers="d72355e153">
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">var AffectedResults = {};

switch(UserExitId) {
</code></pre>
              </td>
              <td class="slds-cell-wrap" data-label="Description" headers="d72355e156">
                <p>Declaring return variable and start of the switch statement</p>
              </td>
            </tr>
            <tr class="">
              <td class="slds-cell-wrap" data-label="Sort Order" headers="d72355e150">2</td>
              <td class="slds-cell-wrap" data-label="User Exit Content" headers="d72355e153">
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">case "100_CalcResult_BasePrice_ext":

    if(Utils.isDefined(ProductAttributes[0].text1) &amp;&amp; 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;
</code></pre>
              </td>
              <td class="slds-cell-wrap" data-label="Description" headers="d72355e156">Logic that handles the user exit id “100_CalcResult_BasePrice_ext””</td>
            </tr>
            <tr class="">
              <td class="slds-cell-wrap" data-label="Sort Order" headers="d72355e150">3</td>
              <td class="slds-cell-wrap" data-label="User Exit Content" headers="d72355e153">
                <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code class="language-html">}
return AffectedResults;
</code></pre>
              </td>
              <td class="slds-cell-wrap" data-label="Description" headers="d72355e156">Closing the switch statement and returning the return variable</td>
            </tr>
          </tbody></table>
7. From the App Launcher, find and select **Calculation Schemas**.
8. Select a calculation schema, and click **Edit**.
9. 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.
10. 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.
11. Click **Save**.