Run an Apex Batch Process Manually

If you can’t wait for a scheduled Apex batch process to run at the scheduled time, you can run the batch process manually.

Required Editions

Available in: Lightning Experience in Professional, Enterprise, and Unlimited Editions that have Consumer Goods Cloud enabled
  1. From Setup, select Developer Console.
  2. Select Debug | Open Execute Anonymous Window.
  3. To run the batch process manually, enter the required Apex classes sequentially.
    For example:
    cgc_sync.PicklistAttributesMappingBatch picklistbatch = new cgc_sync.PicklistAttributesMappingBatch(); 
    Id picklistBatchJobId = Database.executeBatch(picklistbatch, 100);
    
    cgcloud.EffectiveAccountManagerSyncBatch effAccMgrbatch = new cgcloud.EffectiveAccountManagerSyncBatch(); 
    Id effAccMgrbatchJobId = Database.executeBatch(effAccMgrbatch, 100);
    
    cgcloud.FlattenAccountHierarchyBatch flattenAccBatch = new cgcloud.FlattenAccountHierarchyBatch(); 
    Id flattenAccBatchJobId = Database.executeBatch(flattenAccBatch, 100);
    
    cgcloud.AggregatePromotionBatch aggPrmoBatch = new cgcloud.AggregatePromotionBatch(); 
    Id aggPrmoBatchJobId = Database.executeBatch(aggPrmoBatch, 100);
    
    cgcloud.AccountManagerOrgUnitBased accMgrOrgUnit= new cgcloud.AccountManagerOrgUnitBased(); 
    Id accMgrOrgUnitJobId = Database.executeBatch(accMgrOrgUnit, 100);
    
    cgcloud.AuthorizationListSetupBatch authListSetupBatch = new cgcloud.AuthorizationListSetupBatch(); 
    Id authListSetupBatchJobId = Database.executeBatch(authListSetupBatch, 100);
  4. Click Execute.
  5. To automatically open the log in the Log Inspector, select Open Log.
    After the code runs, the debug log is listed on the Logs tab.
  6. To open the log, double-click it.