Use this event to
Filter Production Consumption Lines to be displayed at the mobile device.
Description
Affects which Production Consumption Lines are displayed (lines from Prod. Order Component table).
With this event you can perform basic record filtering.
See also: OnGetProdConsumptionLines_OnIncludeProdOrderComponent
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLines_OnSetFilterProdOrderLine', '', true, true)]
local procedure OnGetProdOrderLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; var _ProdOrderLine: Record "Prod. Order Line"; var _ProductionOrder: Record "Production Order"; var _IsHandled: Boolean)
begin
end;
Example
// [Example] Display all production orders instead of empty list if StartingDate-filter excludes everything
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLines_OnSetFilterProdOrderLine', '', true, true)]
local procedure MyOnGetProdOrderLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; var _ProdOrderLine: Record "Prod. Order Line"; var _ProductionOrder: Record "Production Order"; var _IsHandled: Boolean)
var
StartingDate: Date;
begin
if _HeaderFilter.Name = 'StartingDate' then begin
StartingDate := _HeaderFilter.GetValueAsDate();
if StartingDate <> 0D then
_ProdOrderLine.SetFilter("Starting Date-Time", '<%1', CreateDateTime(StartingDate + 1, 0T));
if _ProdOrderLine.IsEmpty() then
_ProdOrderLine.SetRange("Starting Date-Time");
_IsHandled := true;
end;
end;
More examples
There are no items with the selected labels at this time.
Version History
Version | Changes |
---|---|
MOB5.22 | Introduced |