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 2 Next »

Use this event to

Create new steps for existing and new Adhoc RegistrationTypes.


See also: 
OnGetRegistrationConfiguration_OnAfterAddStep
OnGetRegistrationConfigurationOnCustomRegistrationType_OnAddStepsAsXml


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;



More examples


Version History

VersionChanges
MOB5.14Introduced



  • No labels