OnGetPickOrderLines_OnAfterSetFromAnyLine

Use this event to

Populate values on Order Lines displayed at the mobile device (derived from any of four associated line tables). Parameters includes a RecRef-instance for the line table.

This event is executed after each of the following events has been executed already:


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Pick", 'OnGetPickOrderLines_OnAfterSetFromAnyLine''', true, true)]
    local procedure OnGetPickOrderLines_OnAfterSetFromAnyLine(_RecRef: RecordRefvar _BaseOrderLineElement: Record "MOB Ns BaseDataModel Element")
    begin
    end;

 

Example 1: Set value for DisplayLine5

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Pick", 'OnGetPickOrderLines_OnAfterSetFromAnyLine''', true, true)]
    local procedure MyOnGetPickOrderLines_OnAfterSetFromAnyLine(_RecRef: RecordRefvar _BaseOrderLineElement: Record "MOB Ns BaseDataModel Element")
    var
        Item: Record Item;
    begin
        Item.Get(_BaseOrderLineElement.Get_ItemNumber());     // Get the Item record of the current order line by using a helper function on the BaseOrderLineElement that returns the this value

        if (Item."Special Equipment Code" <> ''then begin
            _BaseOrderLineElement.Set_DisplayLine5('Using special equipment is mandatory');
            _BaseOrderLineElement.SetValue('SpecialequipmentCode''SpecialequipmentCode: ' + Item."Special Equipment Code");
        end else begin
            _BaseOrderLineElement.Set_DisplayLine5('');
            _BaseOrderLineElement.SetValue('SpecialEquipmentCode''');
        end;
    end;

Example 2: Sorting order lines by Quantity


    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrderLines_OnAfterSetFromAnyLine', '', true, true)]
    local procedure My2aOnGetPickOrderLines_OnAfterSetFromAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB Ns BaseDataModel Element")
    var
        MobToolbox: Codeunit "MOB Toolbox";
        Quantity: Decimal;
    begin
        Quantity := MobToolbox.Text2Decimal(_BaseOrderLineElement.Get_Quantity());
        _BaseOrderLineElement.Set_Sorting1(Round(Quantity, 1));
    end;


More examples


Version History

VersionChanges
MOB5.00Introduced