OnPostAssemblyOrder_OnHandleRegistrationForAssemblyHeader
Use this event to
Handle collected values from Registrations (“Line Steps”) for the topmost element representing 'Output'
Description
This event is used to handle collected "line" level steps for the topmost element representing 'Output' (added from the OnGetAssemblyOrderLines_OnAddStepsToOutputLine event) and is executed once for each individual Mobile WMS Registration.
Examples of use could be:
- Write collected values to new or existing fields in the database that subsequently can be accessed from standard posting function events.
- Validate collected values against live data since registration at the mobile device is mostly conducted offline.
- Not to process "header" level steps. Steps added via OnAddStepsToAssemblyHeader[...] is better handled via OnPostAssemblyOrder_OnBeforePostAssemblyOrder-event.
Commit
Database transactions in this event is committed to database prior to calling standard BC posting routines. Your customized code must be structured accordingly.
However, since the Production Journal is used for the posting, all journal lines for the UserId is consistently disposed and recreated between each posting attempt.
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Assembly", 'OnPostAssemblyOrder_OnHandleRegistrationForAssemblyHeader', '', true, true)]
local procedure OnPostAssemblyOrder_OnHandleRegistrationForAssemblyHeader(var _Registration: Record "MOB WMS Registration"; var _AssemblyHeader: Record "Assembly Header"; var _NewReservationEntry: Record "Reservation Entry")
begin
end;
Example
// [Example] Verify custom step 'CustomGrossWeightGrams' is in the Xml file and can be read from 'MOB WMS Registration' later
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Assembly", 'OnPostAssemblyOrder_OnHandleRegistrationForAssemblyHeader', '', true, true)]
local procedure MyOnPostAssemblyOrder_OnHandleRegistrationForAssemblyHeader(var _Registration: Record "MOB WMS Registration"; var _AssemblyHeader: Record "Assembly Header"; var _NewReservationEntry: Record "Reservation Entry")
begin
// Example: Throw error if custom step is not in Xml
// Step was created in OnGetAssemblyOrderLines_OnAddStepsToOutputLine
_Registration.GetValueAsDecimal('CustomGrossWeightGrams', true);
// Add your custom code here...
end;
More examples
-
Case: Add Line Steps to Warehouse Receipts — A customer wishes to start using Item NetWeight and -GrossWeight, but have currently no values registered at the Item Card. Create a temporary customization is to collect these weights when goods are received.
-
How-to: Add Line Step — Add Steps to be displayed during a line registration on planned functions
-
How-to: Subscribing to standard events — You may subscribe to posting events in the Business Central base App to process collected values, or when events offered by Extension API do not fit your exact need.
Version History
Version | Changes |
---|---|
MOB5.24 | Introduced |