Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Use this event to

Excerpt

Add/Replace steps or Manipulate Header Field Values before standard steps are generated

Description

  • Add custom steps
  • Replace standard steps with custom logic
  • Manipulate Header Field Values before standard steps are generated

...

This event is triggered before existing unplanned functions generates their steps, allowing you to manipulate how they are created.

You can also add your own steps or replace standard logic entirely using "IsHandled".

Template


    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnBeforeAddSteps', '', true, true)]
    localprocedure OnGetRegistrationConfiguration_OnBeforeAddSteps(_RegistrationType: Text; var _HeaderFieldValues: Record"MOB NS Request Element"; var _Steps: Record"MOB Steps Element"; var _RegistrationTypeTracking: Text; var _IsHandled: Boolean)
    begin
    end;

Parameters

Expand
titleClick here for parameters...
  • _RegistrationType: The registration type you want to manipulate. "UnplannedMove", "UnplannedCount", "AdjustQuantity" etc.
  • _Steps: The resulting Steps to display
  • _IsHandled: Handling the registration type will replace the standard logic entirely
  • _HeaderFieldValues: Values from Header
  • _RegistrationTypeTracking: Optional tracking information for Mobile Document Queue List

Example

Add a new step to Unplanned Move, collecting a "Reason Code" for the movement. 


    // Example 1: Add Reason Code step to Unplanned Move
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnBeforeAddSteps', '', true, true)]
    localprocedure OnGetRegistrationConfiguration_OnBeforeAddSteps(_RegistrationType: Text; var _HeaderFieldValues: Record"MOB NS Request Element"; var _Steps: Record"MOB Steps Element"; var _RegistrationTypeTracking: Text; var _IsHandled: Boolean)
    var
        MobWmsToolbox: Codeunit"MOB WMS Toolbox";
        Location: Text;
    begin
        if _RegistrationType <> MobWmsToolbox."CONST::UnplannedMove"() then
            exit;

        // Create step for Reason Code. Id 95 is not used by standard steps.
        _Steps.Create_ListStep_ReasonCode(95, _HeaderFieldValues.Get_ItemNumber());
    end;
    
    // Read the Reason Code from request and apply to Whse. Journal Line
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnUnplannedMove_OnAfterCreateWhseJnlLine', '', true, true)]
    localprocedure MyOnPostAdhocRegistrationOnUnplannedMove_OnAfterCreateWhseJnlLine(var _RequestValues: Record"MOB NS Request Element"; var _WhseJnlLine: Record"Warehouse Journal Line")
    begin        // Read Reason Code from request and apply to Whse. Journal Line
        _WhseJnlLine.Validate("Reason Code", _RequestValues.GetValue('ReasonCode'));
    end;




Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "example" and label = "adhoc" and label = "onbeforeaddsteps"


Version History

Version

Changes

MOB5.48Introduced

...