Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Use this event to

Handle collected values from Production Output steps.

Description

This event is used to handle collected steps for Production Output and is executed as soon as the final Step is collected on the mobile device.

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.

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.


Production Output is implemented as Lookup-page, as opposed to the Production Consumption (being the OrderLines-page in an OrderList/OrderLines service).
For this reason events is named consistently with other OnLookup- / OnAdhocRegistration-events, rather than with Production Consumption-events.

The parallel for Production Consumption would be the  OnPostProdConsumption_OnHandleRegistrationForProductionJnlLine event.

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnProdOutput_OnAfterCreateProductionJnlLine''', true, true)]
    local procedure OnPostAdhocRegistrationOnProdOutput_OnAfterCreateProductionJnlLine(var _RequestValues: Record "MOB NS Request Element"; var _ProductionJnlLine: Record "Item Journal Line")
    begin
    end;

Example

    // [Example]  Populate Production Journal "Stop Code" from custom step
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnProdOutput_OnAfterCreateProductionJnlLine''', true, true)]
    local procedure MyOnPostAdhocRegistrationOnProdOutput_OnAfterCreateProductionJnlLine(var _RequestValues: Record "MOB NS Request Element"; var _ProductionJnlLine: Record "Item Journal Line")
    var
        StopCode: Code[10];
    begin
        Evaluate(StopCode, _RequestValues.GetValue('MyCustomStopCode', true));
        if StopCode <> '' then
            _ProductionJnlLine.Validate("Stop Code", StopCode);
    end;



More examples

  

Version History

VersionChanges
MOB5.22Introduced
  • No labels