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.