Use this event to
Change sort order for Orders at the mobile device.
Description
You may use this event only to change sort order of the Prod. Order Lines displayed at the mobile device. You cannot set any values from this event.
Consider when defining your custom sorting whether the Orders should still be organized by where-collected-from (default behavior) or if orders should now be sorted across sources.
Sorting by existing fields
Change sorting key
- Use
.SetCurrentKey(field)
-function with any of the existing fields from the Line table (Record parameter on this event).
- Use
Change sorting direction
- Use
.Ascending(true/false)
-function.
- Use
Sorting by custom fields
Change sorting key
- Not possible from this event. Use OnGetProdOrderLines_OnAfterSetFromProdOrderLine with the
Set_Sorting1()-
function instead.
- Not possible from this event. Use OnGetProdOrderLines_OnAfterSetFromProdOrderLine with the
Change sorting direction
- This requires two steps for custom fields:
- Use OnGetProdOrderLines_OnAfterSetFromProdOrderLine with
Set_Sorting1()
-function as described above. - Then use
.Ascending()
-function in this event.
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLines_OnAfterSetCurrentKey', '', true, true)]
local procedure OnGetProdOrderLines_OnAfterSetCurrentKey(var _BaseOrderElementView: Record "MOB Ns BaseDataModel Element")
begin
end;
Example
// [Example] Change sorting to ascending item name (= tag "HeaderValue2" in the Xml)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLines_OnAfterSetCurrentKey', '', true, true)]
local procedure MyOnGetProdOrderLines_OnAfterSetCurrentKey(var _BaseOrderElementView: Record "MOB Ns BaseDataModel Element")
begin
_BaseOrderElementView.SetCurrentKey(HeaderValue2);
_BaseOrderElementView.Ascending(true);
end;
More examples
-
How-to: Sorting of Orders — Examples of sorting Order list
Version History
Version | Changes |
---|---|
MOB5.22 | Introduced |