OnPostProdConsumption_OnHandleRegistrationForProductionJnlLine

Use this event to

Handle collected values from Registrations (“Line Steps”).

Description

This event is used to handle collected "line" level steps for consumption 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 OnAddStepsToProdOrderLine[...] is better handled via OnPostProdConsumption_OnBeforePostProdOrderLine-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::CodeunitCodeunit::"MOB WMS Production Consumption", 'OnPostProdConsumption_OnHandleRegistrationForProductionJnlLine''', true, true)]
    local procedure OnPostProdConsumption_OnHandleRegistrationForProductionJnlLine(var _Registration: Record "MOB WMS Registration"; var _ProductionJnlLine: Record "Item Journal Line")
    begin
    end;

Example

    // [Example]  Verify quantity at Registration will not be rounded during posting process but can be posted exactly as-is
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Production Consumption", 'OnPostProdConsumption_OnHandleRegistrationForProductionJnlLine''', true, true)]
    local procedure MyOnPostProdConsumption_OnHandleRegistrationForProductionJnlLine(var _Registration: Record "MOB WMS Registration"; var _ProductionJnlLine: Record "Item Journal Line")
    var
        UoMMgt: Codeunit "Unit of Measure Management";
    begin
        _Registration.TestField(Quantity, Round(_Registration.Quantity, UoMMgt.QtyRndPrecision()));
    end;



More examples

  

Version History

VersionChanges
MOB5.22Introduced