Versions Compared

Key

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


Note

This article requires Mobile WMS Extension version 5.16 or later.

...

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB Print", 'OnLookupOnPrintLabel_OnAddStepsForTemplate''', true, true)]
    local procedure MyOnLookupOnPrintLabel_OnAddStepsForTemplate(_TemplateName: Text[50]; var _Steps: Record "MOB Steps Element"; var _Dataset: Record "MOB Common Element")
    var
        Item: Record Item;
    begin

        // Make sure we only handle our own Label-Template
        if _TemplateName <> 'MyItemLabel' then
            exit;

        // Check if Item No. is already collected/transferred to Dataset
        if Item.Get(_Dataset.GetValue('ItemNumber')) then
            // Add an information step using the Item no.
            _Steps.Create_InformationStep(10'InfoStep''Information''''You are printing with Item:' + Item."No.");

        // Delete the unwanted Quantity-step
        _Steps.SetRange(name, 'QuantityPerLabel');
        if _Steps.FindFirst() then
            _Steps.Set_visible(false);
        _Steps.SetRange(name)// Reset the filter so the next event is not affected by you
    end;

Inspect the functionality

...