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

Use this event to

Populate values in Orders displayed at the mobile device (derived from any of four associated header tables). Parameters includes a RecRef-instance for the header table.


This event is executed after each of these following events have been executed already:


Template

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

Example 1

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Pick", 'OnGetPickOrders_OnAfterSetFromAnyHeader''', true, true)]
    local procedure MyOnGetPickOrders_OnAfterSetFromAnyHeader(_RecRef: RecordRefvar _BaseOrderElement: Record "MOB Ns BaseDataModel Element")
    var
        DataTypeManagement: Codeunit "Data Type Management";
        NewFieldRef: FieldRef;
    begin
        if DataTypeManagement.FindFieldByName(_RecRef, NewFieldRef, 'Assigned User ID'then
            _BaseOrderElement.SetValue('MyAssignedUserID''Assigned to: ' + CopyStr(NewFieldRef.Value()1, NewFieldRef.Length()));

        _BaseOrderElement.Set_DisplayLine2('Set from OnGetPickOrders_OnAfterSetFromAnyHeader')// override value previously set at table event
    end;

Example 2

    // [Example]: Sort by custom tag
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Pick", 'OnGetPickOrders_OnAfterSetFromAnyHeader''', true, true)]
    local procedure MySortByCustomTag_OnGetPickOrders_OnAfterSetFromAnyHeader(_RecRef: RecordRefvar _BaseOrderElement: Record "MOB Ns BaseDataModel Element")
    var
        DataTypeManagement: Codeunit "Data Type Management";
        NewFieldRef: FieldRef;
    begin
        if DataTypeManagement.FindFieldByName(_RecRef, NewFieldRef, 'Assigned User ID'then
            _BaseOrderElement.SetValue('AssignedUserID''Assigned to: ' + CopyStr(NewFieldRef.Value()1, NewFieldRef.Length()));

        _BaseOrderElement.Set_Sorting1(_BaseOrderElement.GetValue('AssignedUserID'));
        _BaseOrderElement.Set_Sorting2(_BaseOrderElement.Get_ItemNumber());
    end;


More examples


Version History

VersionChanges
MOB5.00Introduced
  • No labels