Versions Compared

Key

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

Use this event to

Excerpt

Create new steps for existing and new Modify properties for any single step for Adhoc RegistrationTypes.



See also: 
OnGetRegistrationConfiguration_OnAfterAddStep
OnGetRegistrationConfigurationOnCustomRegistrationType_OnAddStepsAsXml


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_OnAddSteps''', true, true)]
    procedure OnGetRegistrationConfiguration_OnAddSteps(_RegistrationType: Textvar _HeaderFilter: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text[200])
    begin
    end;

Example

    // Get RegistrationConfiguration for RegistrationType=ItemDimensions, add  additional step for Cubage
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAddSteps''', true, true)]
    procedure MyOnGetRegistrationConfiguration_OnAddSteps(_RegistrationType: Textvar _HeaderFilter: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text[200])
    var
        ItemUoM: Record "Item Unit of Measure";
        MobToolbox: Codeunit "MOB Toolbox";
        MobWmsLanguage: Codeunit "MOB WMS Language";
        MobWmsToolbox: Codeunit "MOB WMS Toolbox";
        ItemNo: Code[20];
        VariantCode: Code[10];
        UnitOfMeasureCode: Code[10];
        UoMExists: Boolean;
    begin
        if _RegistrationType = MobWmsToolbox."CONST::ItemDimensions"() then begin
            ItemNo := MobWmsToolbox.SearchItemCrossRef(CopyStr(MobToolbox.ReadEAN(_HeaderFilter.GetValue('ItemNumber'))120), VariantCode);
            UnitOfMeasureCode := CopyStr(_HeaderFilter.GetValue('UnitOfMeasure')110);


            ItemUoM.Reset();
            ItemUoM.SetRange("Item No.", ItemNo);
            ItemUoM.SetRange(Code, UnitOfMeasureCode);
            UoMExists := ItemUoM.FindFirst();

            with _Steps do begin
                // STEP: Cubage
                Create_QuantityStep(50, ItemNo);
                Set_name('Cubage');
                Set_header(MobWmsLanguage.GetMessage('ENTER_CUBAGE'));
                Set_label(MobWmsLanguage.GetMessage('CUBAGE_LABEL'':');
                Set_eanAI('');
                if UoMExists then
                    Set_defaultValue(ItemUoM.Cubage);
                Set_minValue(0);
            end;
        end;
    end;



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

...