---
schema_version: "1"
id: 9b075bd92e6f0e5f58407475c51cd481f27c9c001a63306a587e5eeca9808623
title: Run Complex Pricing Batch Processes
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_task_admin_run_batch_processes.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_run_batch_processes.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 71082b42d0fe82ccd6823d0cf454ca70efcd2194a05d2db03915233f553db51e
description: Run the batch processes to flatten the account and org unit hierarchies and populate the complex pricing conditions. Flatten account hierarchy and org unit hierarchy batch is required for searching across all customer hierarchy levels and applying the relevant conditions. Post the completion of the pricing worker batch process, the pricing condition table the correct mapping.
products:
  - Consumer Goods
release: "264"
---
# Run Complex Pricing Batch Processes

Run the batch processes to flatten the account and org unit hierarchies and populate the complex pricing conditions. Flatten account hierarchy and org unit hierarchy batch is required for searching across all customer hierarchy levels and applying the relevant conditions. Post the completion of the pricing worker batch process, the pricing condition table the correct mapping.

### Required Editions

Set up tenant pairing. See [Set Up Consumer Goods Cloud Processing Services](https://help.salesforce.com/s/articleView?id=ind.cg_concept_admin_pair_processing_service.htm&release=264.0.0&type=5 "To maintain uninterrupted connectivity with and access to the Salesforce org, create a connected app and pair the Salesforce org with the CG Cloud Processing Service.") for more information.

<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;">
              <p>Available in: Lightning Experience</p>
              <p style="margin-bottom:0;">Available in: <strong>Enterprise</strong> and
                <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled
              </p>
            </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="d25670e54">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d25670e54 ">To run batch processes:</td>
            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d25670e54 ">
              <p>(CGCloud Business Admin OR CGCloud Retail Business Admin)</p>
              <p style="margin-bottom:0;">AND</p>
              <p style="margin-bottom:0;">Penny Perfect
                Pricing</p>
            </td>
          </tr>
        </tbody>
      </table>

1. Log in to Salesforce.
2. From Setup, select **Developer Console**.
3. To open the Enter Apex Code window, select **Debug** and then select **Open Execute Anonymous Window**.
4. Enter the batch process.
    
    `#NAMESPACE#.ScheduleCGCloudServFlattenAccHierarchy f = new #NAMESPACE#.ScheduleCGCloudServFlattenAccHierarchy(); f.execute(null);`
    
    Replace the namespace with the namespace for the org.
5. Click **Execute**.
6. Enter the batch process.
    
    `#NAMESPACE#.ScheduleCGCloudServiceFlattenOrgUnit effAccMgrbatch = new #NAMESPACE#.ScheduleCGCloudServiceFlattenOrgUnit(); effAccMgrbatch.execute(null);`
    
    Replace the namespace with the namespace for the org.
7. Click **Execute**.
8. Enter the batch process.
    
    `#NAMESPACE#.ScheduleCGCloudServiceComplexPricing f = new #NAMESPACE#.ScheduleCGCloudServiceComplexPricing(); f.execute(null);`
    
    Replace the namespace with the namespace for the org.
9. Click **Execute**.
10. From App Launcher, find and select **Batch Run Status**.
11. Check if the three batches have run successfully.

The pricing condition tables are populated with the correct mapping and hash values (merge key, pricing condition template, and key type).