Use this event to
Filter orders (Assembly Headers) to be displayed at the mobile device.
Description
Affects which Assembly Headers are displayed. This event "handles" each filter.
With this event you can perform basic record filtering of Assembly Orders.
See also: OnGetAssemblyOrders_OnIncludeAssemblyHeader
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Assembly", 'OnGetAssemblyOrders_OnSetFilterAssemblyHeader', '', true, true)]
local procedure OnGetAssemblyOrders_OnSetFilterAssemblyHeader(_HeaderFilter: Record "MOB NS Request Element"; var _AssemblyHeader: Record "Assembly Header"; var _AssemblyLine: Record "Assembly Line"; var _IsHandled: Boolean)
begin
end;
Example
// [Example] Display all assembly orders instead of empty list if StartingDate-filter excludes everything
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Assembly", 'OnGetAssemblyOrders_OnSetFilterAssemblyHeader', '', true, true)]
local procedure MyOnGetAssemblyOrders_OnSetFilterAssemblyHeader(_HeaderFilter: Record "MOB NS Request Element"; var _AssemblyHeader: Record "Assembly Header"; var _AssemblyLine: Record "Assembly Line"; var _IsHandled: Boolean)
var
StartingDate: Date;
begin
if _HeaderFilter.Name = 'StartingDate' then begin
StartingDate := _HeaderFilter.GetValueAsDate();
if StartingDate <> 0D then
_AssemblyHeader.SetFilter("Starting Date", '<=%1', StartingDate);
if _AssemblyHeader.IsEmpty() then
_AssemblyHeader.SetRange("Starting Date");
_IsHandled := true;
end;
end;
More examples
-
Case: Filter Bin Content for specific Serial No. — Filter Lookup Bin Content for a specific Serial No.
-
Case: Filter Inventory Movements of Asmbl. Orders for specific Sales Order — The user wants to filter Warehouse Documents on specific Sales Order number, using the existing Planned Movements function.
-
How-to: Filter Order Lines — Examples of filtering Order Lines .
-
How-to: Filter Orders — Examples for including/excluding orders using basic filtering
-
How-to: Filter Orders - Complex — Examples for including/excluding orders using complex per-document filtering
-
How-to: Search - Add new HeaderField to existing SearchType — Add a new custom HeaderField to the existing "magnifying glass" SearchType 'ItemSearch' and show a simple search response.
Version History
Version | Changes |
---|---|
MOB5.24 | Introduced |