---
schema_version: "1"
id: 335db1165c2802f2cf31bc4906c4bffa053870b9277edb22f42d92b28ee98fde
title: AggregatePromotionBatch
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_reference_admin_aggregate_promotion_batch.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_reference_admin_aggregate_promotion_batch.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 6afab45e3344410367f6c68e777551e2ba9ecc8eb501e26fd93fc4ca048ced35
description: To show the promotions for visits or show the promoted products for orders, create promotion store records that link promotions to stores by using the AggregatePromotionBatch batch. A retail promotion is set up using either an anchor account or an anchor account set. The anchor account is higher in the account hierarchy. Lower-level accounts are designated valid stores (Current Date is between Store Valid From and Store Valid Thru dates in Account Extension).
products:
  - Consumer Goods
release: "264"
---
# AggregatePromotionBatch

To show the promotions for visits or show the promoted products for orders, create promotion store records that link promotions to stores by using the AggregatePromotionBatch batch. A retail promotion is set up using either an anchor account or an anchor account set. The anchor account is higher in the account hierarchy. Lower-level accounts are designated valid stores (Current Date is between Store Valid From and Store Valid Thru dates in Account Extension).

### 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;">
            <p>Available in: Lightning Experience </p>
            <p style="margin-bottom:0;">Available in: <strong>Enterprise</strong> and
              <strong>Unlimited</strong> Editions where Consumer Goods Cloud is enabled
            </p>
          </td>

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

## Considerations

Keep these considerations in mind during the batch run.

- The batch handles the promotions that have an anchor account (the Anchor Customer field isn’t null).
- To find the store accounts, the batch job looks into the account hierarchy by using the flatten account hierarchy.
- The batch doesn’t consider the promotions that have an anchor customer set for batch processing. The accounts in the customer set are directly targeted for ‌promotion, eliminating the need for hierarchical checks.
- The batch runs ad-hoc or can be scheduled periodically and Salesforce runs the batch at the given time interval. If the batch is scheduled, it runs with a batch size in the corresponding batch process configuration record. If no batch process configuration record is found, it runs with the default batch size in the class, which is 1. Batch process configuration records are shipped via static resource CSV files during the org setup.

## Batch Job Details

- The batch retrieves the promotions that have:
    - The Active field as checked
    - Current Date between Date From and Date Thru
    - Phase as Committed
    - Anchor Account as not null
    - Record Type as SellablePromotion (Starting from Spring ’25)
- The batch process finds the stores that belong to the anchor account hierarchy.
- The batch creates promotion store records linking the promotion to the store for the anchor account. The batch verifies if promotion store records are added or removed for each batch run.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/images/icon_example.png)

Example

Here are the promotions and flatten account hierarchy for NTO Atlanta.

Advanced Promotion

     
| Slogan | Active | Anchor Customer | Date From | Date Thru | Phase |
| --- | --- | --- | --- | --- | --- |
| Special Cookies | Checked | NTO Atlanta | 1/1/2000 | 1/1/2099 | Committed |

Flatten Account Hierarchy

    
| Account | Node Level | Account Level 01 | Account Level 02 | Result Level |
| --- | --- | --- | --- | --- |
| NTO Atlanta | 1 | NTO Atlanta |   | Trade Org |
| NTO Store | 2 | NTO Atlanta | NTO Store | Store |

This batch creates these promotion store records.

Promotion Store

 
| Promotion | Store |
| --- | --- |
| Special Cookies | NTO Store |