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

Use this event to

Create steps for existing and new Unplanned Functions.


See also: 
OnGetRegistrationConfiguration_OnAfterAddStep

Template

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


Example

    // [Example] Get RegistrationConfiguration for RegistrationType=ItemDimensions, add additional step for collecting Cubage (default behaviour is calculating Cubage based on Height*Width*Length)
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAddSteps''', true, true)]
    local procedure MyOnGetRegistrationConfiguration_OnAddSteps(_RegistrationType: Textvar _HeaderFieldValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text)
    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(_HeaderFieldValues.GetValue('ItemNumber'))120), VariantCode);
            UnitOfMeasureCode := CopyStr(_HeaderFieldValues.GetValue('UnitOfMeasure')110);



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

            with _Steps do begin
                // STEP: Information step including html (html is supported for InformationStep helpLabel and Whse. Lookup-responses)
                Create_InformationStep(50'Information');
                Set_header('New dimension');
                Set_helpLabel(MobWmsLanguage.GetMessage('ENTER_CUBAGE'' <b><font color="red">in m3</font></b>');

                // STEP: Cubage (from 'Quantity' Template)
                Create_DecimalStep_Quantity(55, 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
MOB5.15Parameter _RegistrationTypeTracking changed from Text[200] to Text
MOB5.15Parameter _HeaderFilter renamed to _HeaderFieldValues
  • No labels