Versions Compared

Key

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

Use this event to

Excerpt

Create HeaderFields or Add HeaderFields to existing headers.

...

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_HeaderFields.InitConfigurationKey('MyNewConfigurationKey')// Identifier for new ConfigurationKey - replace by your own key name


                    // Add headerConfiguration elements here
                    // ...
                    // Create _HeaderFields.Create_TextField(...);
                    // Set _HeaderFields.Set_...;
                    // Set _HeaderFields.Set_...;
                    //
                    // Create _HeaderFields.Create_IntegerField(...);
                    // Set _HeaderFields.Set_...;
                    // Set _HeaderFields.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        _HeaderFields.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        _HeaderFields.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 My03OnGetReferenceData_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        _HeaderFields.InitConfigurationKey('CustomPrintLabel');
            
        //
                    // Add headerConfiguration elements here
                    // 
            
        // ItemNumber
            Create        _HeaderFields.Create_TextField(1'ItemNumber');
            Set        _HeaderFields.Set_label(MobWmsLanguage.GetMessage('ITEM'':');
            Set        _HeaderFields.Set_clearOnClear(true);
            Set        _HeaderFields.Set_acceptBarcode(true);
            Set        _HeaderFields.Set_length(20);
            Set        _HeaderFields.Set_searchType('ItemSearch');
            Set        _HeaderFields.Set_eanAi(MobToolbox.GetItemNoGS1Ai());
            
        // LotNumber
            Create        _HeaderFields.Create_TextField(2'LotNumber');
            Set        _HeaderFields.Set_label(MobWmsLanguage.GetMessage('LOT_NO_LABEL'':');
            Set        _HeaderFields.Set_clearOnClear(true);
            Set        _HeaderFields.Set_acceptBarcode(true);
            Set        _HeaderFields.Set_length(20);
            Set        _HeaderFields.Set_eanAi(MobToolbox.GetLotNoGS1Ai());
            
        // ExpirationDate
            Create        _HeaderFields.Create_DateField(3'ExpirationDate');
            Set        _HeaderFields.Set_label(MobWmsLanguage.GetMessage('EXP_DATE_LABEL'':');
            Set        _HeaderFields.Set_clearOnClear(false);
            Set        _HeaderFields.Set_acceptBarcode(true);
            Set        _HeaderFields.Set_eanAi(MobToolbox.GetExpirationDateGS1Ai());
            
        // Quantity
            Create
        _HeaderFields.Create_IntegerField(4'Quantity');
            Set        _HeaderFields.Set_label(MobWmsLanguage.GetMessage('QUANTITY'':');
            Set        _HeaderFields.Set_clearOnClear(true);
            Set        _HeaderFields.Set_acceptBarcode(true);
            Set        _HeaderFields.Set_minValue(0);
            Set        _HeaderFields.Set_eanAi(MobToolbox.GetQuantityGS1Ai());
            
        // NumberOfLabels
            Create        _HeaderFields.Create_IntegerField(5'NumberOfLabels');
            Set        _HeaderFields.Set_label(MobWmsLanguage.GetMessage('PRINT_QTY'':');
            Set        _HeaderFields.Set_clearOnClear(true);
            Set        _HeaderFields.Set_acceptBarcode(false);
            Set        _HeaderFields.Set_minValue(0);
            Set        _HeaderFields.Set_maxValue(5);
        end;
    end;


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

...