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. These events can be used to change the behavior of the current Batch Planning
Event definitions:
OnBeforeCreateBatchOrders – This is raised at the beginning of the CreateBatchOrders function. The Handled parameter can be set to TRUE if the event subscriber handles all processing associated with creating the batch orders (causing the standard logic of this function to be bypassed). Additionally, the Created parameter should be set to indicate if any orders have been created; this is necessary because CreateBatchOrders returns a Boolean value indicating if any orders have been created and this parameter will be used as this return value. The standard logic is to delete any existing orders and create new orders according to the specifications specified in the Batch Planning Worksheet. The KeepExistingOrders parameter can be used to bypass deleting the existing orders but continue to use the standard logic for creating the batch and processing orders.
OnAfterCreateBatchOrders – This is raised at the end of the CreateBatchOrders function. In this case, it is assumed that the event subscriber will adjust the batch planning variable so as not to duplicate any existing orders that may have been present. The Created parameter (see the previous notes for OnBeforeCreateBatchOrders) is also used for this event.
OnBeforeModifyFinishedItem – This is raised at the beginning of the ModifyFinishedItem function. The Handled parameter can be set to TRUE if the event subscriber handles all processing associated with modifying the finished item (causing the standard logic of this function to be bypassed). A Boolean parameter (Recalc) is passed to the ModifyFinishedItem function indicating if the batches should be recalculated. This parameter is passed along to the event where it can be modified if necessary.
OnAfterModifyFinishedItem – This is raised at the end of the ModifyFinishedItem function.
OnBeforeModifyBatches – This is raised at the beginning of the ModifyBatches function. The Handled parameter can be set to TRUE if the event subscriber handles all processing associated with modifying the batches (causing the standard logic of this function to be bypassed). A Boolean parameter (Recalc) is passed to the ModifyFinishedItem function indicating if the batches should be recalculated. This parameter is passed along to the event where it can be modified if necessary.
OnAfterModifyBatches – This is raised at the end of the ModifyBatches function.