--- title: "Batch planning function events" slug: "bc-batch-planning-function-events" description: "Explore six integration events in Batch Planning Functions for BC22.0.202307.0, enhancing batch order creation and modification processes effectively." tags: ["BC", "Business Central", "Concept", "Food"] updated: 2026-06-25T09:59:13Z published: 2026-06-25T09:59:13Z canonical: "docs.staedean.com/bc-batch-planning-function-events" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Batch planning function events Six integration events have been defined in the Batch Planning Functions codeunit (CU37002468) on BC22.0.202307.0 and higher. Parameters for these events can be seen in code and for the most part expose the global variables in the codeunit to the event subscribers. Use these events to change the behaviour of the current batch planning. ## Event definitions - **OnBeforeCreateBatchOrders**: raised at the beginning of the **CreateBatchOrders** function. Set the **Handled** parameter to TRUE if the event subscriber handles all processing associated with creating the batch orders, which bypasses the standard logic of this function. Set the **Created** parameter to indicate whether Anywhere Mobility Solutions orders have been created; this is necessary because **CreateBatchOrders** returns a boolean value indicating whether Anywhere Mobility Solutions orders have been created, and this parameter is used as the return value. The standard logic deletes Anywhere Mobility Solutions existing orders and creates new orders according to the specifications in the **Batch Planning Worksheet**. Use the **KeepExistingOrders** parameter to bypass deleting the existing orders while continuing to use the standard logic for creating the batch and processing orders. - **OnAfterCreateBatchOrders**: raised at the end of the **CreateBatchOrders** function. The event subscriber is expected to adjust the batch planning variable so as not to duplicate Anywhere Mobility Solutions existing orders that may have been present. The **Created** parameter (see the notes for **OnBeforeCreateBatchOrders**) is also used for this event. - **OnBeforeModifyFinishedItem**: raised at the beginning of the **ModifyFinishedItem** function. Set the **Handled** parameter to **TRUE** if the event subscriber handles all processing associated with modifying the finished item, which bypasses the standard logic of this function. A boolean parameter (**Recalc**) is passed to the **ModifyFinishedItem** function indicating whether the batches should be recalculated. This parameter is passed to the event where it can be modified if necessary. - **OnAfterModifyFinishedItem**: raised at the end of the **ModifyFinishedItem** function. - **OnBeforeModifyBatches**: raised at the beginning of the **ModifyBatches** function. Set the **Handled** parameter to **TRUE** if the event subscriber handles all processing associated with modifying the batches, which bypasses the standard logic of this function. A boolean parameter (**Recalc**) is passed to the **ModifyFinishedItem** function indicating whether the batches should be recalculated. This parameter is passed to the event where it can be modified if necessary. - **OnAfterModifyBatches**: raised at the end of the **ModifyBatches** function. ## Related - [Plan and schedule production activities](/bc-plan-and-schedule-production-activities.md) - [Assign production planning events](/bc-assign-production-planning-events.md) - [Create a batch order](/bc-create-a-batch-order.md)