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

Use this event to

Create HeaderFields or Add HeaderFields to existing headers.

 

Headers are static data in Reference Data, meaning they are loaded on login and cannot change dynamically.

 

Description

New ConfigurationKeys with HeaderFields can be added using a number of "Create"-methods from the input parameter-table.

  • Call _HeaderConfigurationElement.Create(...) to "set" the ConfigurationKey prior to adding new HeaderFields.
  • "Create_...Field"-methods will take a few, mandatory arguments.
  • "Create_...Field"-methods usually will offer an alternative argument list (other signature) that includes mandatory arguments as well as most commonly used optional arguments.
  • Optional values can also be set subsequently using a number of related "Set_"-methods.

See also: OnGetReferenceData_OnAfterAddHeaderField


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations''', true, true)]
    local procedure OnGetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
    begin
    end;



Example (1)

    // [Example] 01 - Create new custom ConfigurationKey
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations''', true, true)]
    local procedure My01OnGetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
    begin
        with _HeaderFields do begin
            InitConfigurationKey('MyNewConfigurationKey')// Identifier for new ConfigurationKey - replace by your own key name


            // Add headerConfiguration elements here
            // ...
            // Create_TextField(...);
            // Set_...;
            // Set_...;
            //
            // Create_IntegerField(...);
            // Set_...;
            // Set_...;
            ;
        end;
    end;



Example (2)

    // [Example] 02 - Add field to existing ConfigurationKey from standard Mobile WMS 
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations''', true, true)]
    local procedure My02OnGetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
    begin
        with _HeaderFields do begin
            // Add a field to an existing ConfigurationKey from standard Mobile WMS
            InitConfigurationKey('ReceiveOrderFilters');


            // Use existing template 'ItemNumber' to add field, rather than Create_TextField(...)
            // Id 15 = display between Location and Date (Id's 10 and 20)
            Create_TextField_ItemNumber(15);
        end;
    end;




Example (3)

    // [Example] 03 - Add new 'CustomPrintLabel' key with steps for collecting information needed to print a label

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations''', true, true)]
    local procedure OnGetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
    var
        MobToolbox: Codeunit "MOB Toolbox";
        MobWmsLanguage: Codeunit "MOB WMS Language";
    begin
        with _HeaderFields do begin
            //
            // Identifier for new ConfigurationKey - replace by your own key name
            //
            InitConfigurationKey('CustomPrintLabel');


            //
            // Add headerConfiguration elements here
            // 

            // ItemNumber
            Create_TextField(1'ItemNumber');
            Set_label(MobWmsLanguage.GetMessage('ITEM'':');
            Set_clearOnClear(true);
            Set_acceptBarcode(true);
            Set_length(20);
            Set_searchType('ItemSearch');
            Set_eanAi(MobToolbox.GetItemNoGS1Ai());

            // LotNumber
            Create_TextField(2'LotNumber');
            Set_label(MobWmsLanguage.GetMessage('LOT_NO_LABEL'':');
            Set_clearOnClear(true);
            Set_acceptBarcode(true);
            Set_length(20);
            Set_eanAi(MobToolbox.GetLotNoGS1Ai());

            // ExpirationDate
            Create_DateField(3'ExpirationDate');
            Set_label(MobWmsLanguage.GetMessage('EXP_DATE_LABEL'':');
            Set_clearOnClear(false);
            Set_acceptBarcode(true);
            Set_eanAi(MobToolbox.GetExpirationDateGS1Ai());

            // Quantity
            Create_IntegerField(4'Quantity');
            Set_label(MobWmsLanguage.GetMessage('QUANTITY'':');
            Set_clearOnClear(true);
            Set_acceptBarcode(true);
            Set_minValue(0);
            Set_eanAi(MobToolbox.GetQuantityGS1Ai());

            // NumberOfLabels
            Create_IntegerField(5'NumberOfLabels');
            Set_label(MobWmsLanguage.GetMessage('PRINT_QTY'':');
            Set_clearOnClear(true);
            Set_acceptBarcode(false);
            Set_minValue(0);
            Set_maxValue(5);

        end;
    end;


More examples

Version History

VersionChanges
MOB5.00Introduced as OnGetReferenceData_OnAfterCreateHeaderConfigurations
MOB5.14Refactored (renamed and new parameters)
  • No labels