OnAfterGroupByBaseOrderLineElements
Use this event to
Set values to display on a "group header" element created from GroupBy, or suppress the "group header" element.
Always used in conjunction with an [...]_OnAfterSetFrom[...] event.
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Base Document Handler", 'OnAfterGroupByBaseOrderLineElements', '', true, true)]
local procedure OnAfterGroupByBaseOrderLineElements(var _GroupOrderLineElement: Record "MOB Ns BaseDataModel Element"; var _IsGrouped: Boolean; var _BaseOrderLineElements: Record "MOB Ns BaseDataModel Element"; var _IsHandled: Boolean)
begin
end;
Example
How-to: Group matching order lines (GroupBy)
Example (partial code)
... partial code from this how-to:
// Example (Partial code from How-to: Group matching order lines (GroupBy)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Base Document Handler", 'OnAfterGroupByBaseOrderLineElements', '', true, true)]
local procedure MyOnAfterGroupByBaseOrderLineElements(var _GroupOrderLineElement: Record "MOB Ns BaseDataModel Element"; var _IsGrouped: Boolean; var _BaseOrderLineElements: Record "MOB Ns BaseDataModel Element"; var _IsHandled: Boolean)
begin
if (_GroupOrderLineElement.GetValue('MyGroupName') = 'PutAway.GroupBySerialNumber') then begin
_IsGrouped := _BaseOrderLineElements.Count() > 1; // Suppress grouping if this group includes only a single element
_GroupOrderLineElement.Set_DisplayLine4(StrSubstNo('Serial No.: Yes')); // Only used if the elements is actually grouped
// Optional: Since these elements can be grouped/ungrouped on the fly at the mobile device, add some text to indicate this
if _IsGrouped then begin
_BaseOrderLineElements.FindSet();
repeat
_BaseOrderLineElements.Set_DisplayLine4(_BaseOrderLineElements.Get_DisplayLine4() + ' (can be grouped)');
until _BaseOrderLineElements.Next() = 0;
end;
_IsHandled := true;
end;
end;
See also:
-
Case: Register large picks of sequential serial numbers — Customize picking with serial numbers to request a Quantity and Serial Number sequence start number to avoid scanning each serial number individually.
-
How-to: Group matching order lines (GroupBy) — Group matching order lines with the same values and remove redundant line selection and registrations.
Version History
Version | Changes |
---|---|
MOB5.26 | Introduced |