Consumer Goods Cloud Batch Processes

Batch processes condense data for faster consumption within the mobile app, sync engine, or database.

Required Editions

Before you run the Apex batch processes, load master data.

Available in: Lightning Experience
Available in: Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled

Here’s the list of Consumer Goods Cloud batch processes. To schedule an Apex batch process by using the UI, see Schedule an Apex Batch Process.

To Run Apex Class Batch Process Configuration Name Schedulable Through UI Comments
Create, update, or delete customer managers based on the definitions of org unit users. AccountManagerOrgUnitBased AccountManager Yes —
Provide customer managers access to the account. This process adds the current customer managers to the Salesforce Account Team table. EffectiveAccountManagerSyncBatch EffectiveAccountManagerSyncBatch Yes

Starting Winter ‘25, the system runs the enhanced version of this batch by default.

This version of the batch is more efficient as it doesn’t recreate existing account team members from account managers for each batch run. The batch only creates or updates an account team member record for changes in account managers.

Existing customers can use the enhanced version of the batch through a custom setting.

Fill or remove the ParentId field based on the current Trade organization of the Customer Trade organization Hierarchy table. EffectiveAccountParentSyncBatch — Yes —
AccountClearEffectiveParentBatch AccountClearBatch Yes —
Flatten the account hierarchy for a more uniform access in several areas of the app. Several processes need this data. FlattenAccountHierarchyBatch — Yes The FlattenAccountHierarchyBatch Apex batch process ignores and preserves fields in Flatten Account Hierarchy that are outside the CGCloud namespace.
Prepare the data for the listed products to appear in surveys or during order creation. AuthorizationListSetupBatch AuthAggregation Yes —
Prepare the data to show promotions during a visit or to show promotion-related products in the Order module. AggregatePromotionBatch PromotionAggregation Yes —
Mark visits and orders as not relevant to distribution if they’re no longer business-critical for a mobile user. To use this batch process, deploy the metadata from the post installation files. Run CallOrderDistributionReOrgBatch with batch size 1. CallOrderDistributionReOrgBatch CallOrderDistributionReorganization Yes —
Update the picklist repository after you import all relevant picklist files. This process prepares the picklist definitions for the offline mobile app.

PicklistAttributesMappingBatch

PicklistAttributesCleanupBatch

— Yes —
Condense information from the product hierarchy into a single field to determine the associated stock-keeping units (SKU) for surveys and order taking, and to determine promotions planned for these products. KAMProductFindingBatch KAMProducts Yes —
Create job lists from event-driven activities. GenerateJobListBatch JobListGeneration Yes —
Mark asset audits as not relevant to distribution if they’re not business-critical for a mobile user. AssetAuditDistributionReOrgBatch AssetAuditDistributionSetting Yes —
Bulk transfer promotions from Trade Promotion Management to Retail Execution. PromotionTransferBatch PromotionTransfer No

You can’t schedule the promotion transfer batch via the UI because the batch is scheduled per sales org and you can’t specify the sales org attribute in the UI.

Example: To schedule the promotion transfer batch for the sales org 0001 that runs every day at 5 AM:

String salesOrg = '0001';cgcloud.PromotionTransferBatch ptb = new cgcloud.PromotionTransferBatch(salesOrg);String sch = '0 0 5 * * ?';System.schedule('PromotionTransferBatch', sch, ptb);

To schedule a schedulable class, see Apex Scheduler for more details.

Reconcile inventory transactions to get a balanced transaction for product inventory. InventoryTxBalanceCalculationBatch InventoryTxBalanceCalculationBatch Yes —
Use account sharing rules to give users access to supporting accounts, such as wholesalers, delivery recipients, and trade org hierarchies that are specific to one or more sales orgs and user grouping. AccountSharingCriterionBatch — Yes Install the account sharing add-on and make the supporting accounts visible to the user by creating the account sharing rules. See Account Sharing.