Versions Compared

Key

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

Use this event to

...

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

    // Get RegistrationConfiguration for "Item Dimensions" – 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;

        with _Step do
            if Get_name() in ['Length''Width''Height'then
                Set_visible(false);
    end;


Example 2 - Modify list step values


    // Get RegistrationConfiguration for "Unplanned Count" – Modify the standard "Unit Of Measure"-list steps list values and set a default value
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAfterAddStep''', true, true)]
    local 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::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;


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

...