Description
...
The event parameter "_BaseOrderLineElementView" includes five sorting functions you can use to sort on up to four new custom fields .
Example
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnAfterSetCurrentKey', '', true, true)]
procedure OnGetReceiveOrders_OnAfterSetCurrentKey(var _BaseOrderElementView: Record "MOB Ns BaseDataModel Element")
begin
_BaseOrderElementView.SetCurrentKey(BackendID);
_BaseOrderElementView .Ascending(true);end;
Sorting on multiple sourcedocument sources
All except "Ship" have multiple document sources.
...
When working with custom sorting, you will need to consider whether orders should still be "grouped" or can now be mixed across the four document sources.
Example
Example: Existing fields
- Change key to existing field "Item no."
- Change sorting direction to "Descending"
For this task you can use an OnAfterSetCurrentKey event.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnAfterSetCurrentKey', '', true, true)]
procedure OnGetReceiveOrders_OnAfterSetCurrentKey(var _BaseOrderElementView: Record "MOB Ns BaseDataModel Element")
begin
_BaseOrderElementView.SetCurrentKey(BackendID);
_BaseOrderElementView.Ascending(true);
end;
TODO – Keywords:
OnAfterSetCurrentKey:
...