Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Clarify not to create steps here

Use this event to

Excerpt

Modify properties for any single step for Unplanned Functions.

...

Description

This event is executed once for every step added from standard Adhoc DocumentTypes as well as custom Adhoc DocumentTypes.

You may use this event to change any property of the step or hide the step.

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep''', true, true)]
    procedure OnGetRegistrationConfiguration_OnAfterAddStep(_RegistrationType: Textvar _HeaderFieldValues: Record "MOB NS Request Element"; var _Step: Record "MOB Steps Element")
    begin
    end;

Example

    // Get RegistrationConfiguration for RegistrationType=ItemDimensions – hide Length, Width and Height steps
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep''', true, true)]
    procedure MyOnGetRegistrationConfiguration_OnAfterAddStep(_RegistrationType: Textvar _HeaderFieldValues: Record "MOB NS Request Element"; var _Step: Record "MOB Steps Element")
    var
        MobWmsToolbox: Codeunit "MOB WMS Toolbox";
    begin
        if _RegistrationType <> MobWmsToolbox."CONST::ItemDimensions"() then
            exit;

...

Use this event to

Excerpt

Modify properties for any single step, both standard and custom. Not adding steps.


See also: OnGetRegistrationConfiguration_OnAddSteps

Description

This event is executed once for every step added (both standard and custom).

You may use this event to change any property or even hide or delete the step.

This event cannot create steps

The event cannot be used to add new steps.


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep''', true, true)]
    procedure OnGetRegistrationConfiguration_OnAfterAddStep(_RegistrationType: Textvar _HeaderFieldValues: Record "MOB NS Request Element"; var _Step: Record "MOB Steps Element")
    begin
    end;


Example 1 - Hide steps on Item Dimension

    // Get RegistrationConfiguration for "ItemDimensions" – hide Length, Width and Height steps
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep', '', true, true)]
    localprocedureMyOnGetRegistrationConfiguration_OnAfterAddStep01(_RegistrationType: Text; var_HeaderFieldValues: Record"MOB NS Request Element"; var_Step: Record"MOB Steps Element")
    var
        MobWmsToolbox: Codeunit"MOB WMS Toolbox";
    begin
        if_RegistrationType<>MobWmsToolbox."CONST::ItemDimensions"() then
            exit;

        if_Step.Get_name() in ['Length', 'Width', 'Height'] then
            _Step.Set_visible(false);
    end;


Example 2 - Modify list step values on Unplanned Count


    // Get RegistrationConfiguration for "UnplannedCount" – Modify the list values for standard "Unit Of Measure"-list step and set a default value
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep', '', true, true)]
    localprocedureMyOnGetRegistrationConfiguration_OnAfterAddStep02(_RegistrationType: Text; var_HeaderFieldValues: Record"MOB NS Request Element"; var_Step: Record"MOB Steps Element")
    var
        MobWmsToolbox: Codeunit"MOB WMS Toolbox";
    begin
        if_RegistrationType<>MobWmsToolbox."CONST::UnplannedCount"() then
            exit;

        if_Step.Get_name() <>'UoM'then
            exit;

        // Overwrite the standard list values, replace with your own function or data
        // You can make your own function (GetItemUoM) to control the order of values - the format is 'one;two;three'
        _Step.Set_listValues(MobWmsToolbox.GetItemUoM(_HeaderFieldValues.Get_Item()));

        // Optionally set a default value - the value must be present in the list
        _Step.Set_defaultValue('BOX');
    end;


Example 3 - Modify FastForwardMode on Unplanned Count


    // [Example 03]
    // Get RegistrationConfiguration for "UnplannedCount", set FastForwardMode to use all values
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep', '', true, true)]
    localprocedureMyOnGetRegistrationConfiguration_OnAfterAddStep03(_RegistrationType: Text; var_HeaderFieldValues: Record"MOB NS Request Element"; var_Step: Record"MOB Steps Element")
    var
        MobWmsToolbox: Codeunit"MOB WMS Toolbox";
    begin
        if_RegistrationType<>MobWmsToolbox."CONST::UnplannedCount"() then
            exit;

        // Fast forward is for automatically stepping over steps, if their value is already provided in either the input or scanned values.
        // "ScanValues" means scanned barcode values.
        // "Input values" means header values (filters) or values transferred from the lookup/order line.
        // OnlyScanValues = Only barcode values
        // InputAndScanValues = Both barcode and transferred input values
        _Step.Set_fastForwardMode("MOB FastForwardMode"::InputAndScanValues);
    end;


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


Version History

VersionChanges
MOB5.14Introduced
MOB5.15Parameter _HeaderFilter renamed to _HeaderFieldValues