Use this event to
Excerpt |
---|
Add filter conditions for Production Order Lines that cannot be solved by OnSetFilter-event. |
...
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLines_OnSetFilterProdOrderLineOnIncludeProdOrderLine', '', true, true)]
local procedure OnGetProdOrderLines_OnSetFilterProdOrderLineOnIncludeProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; var _ProdOrderLine: Record "Prod. Order Line"; var _ProductionOrderIncludeInOrderList: Record "Production Order"; var _IsHandled: Boolean)
begin
end;
Example
// [Example] Display all production orders instead of empty list if StartingDate-filter excludes everything Hide Production Order Lines if assigned bin code is blocked for movement
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLines_OnSetFilterProdOrderLineOnIncludeProdOrderLine', '', true, true)]
local procedure MyOnGetProdOrderLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; var OnIncludeProdOrderLine(_ProdOrderLine: Record "Prod. Order Line"; var _ProductionOrder: Record "Production Order"; var _IsHandledIncludeInOrderList: Boolean)
var
StartingDate Bin: DateRecord Bin;
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;
ProdOrderLine."Bin Code" <> '') and (Bin.Get(_ProdOrderLine."Location Code", _ProdOrderLine."Bin Code")) and (Bin."Block Movement" <> Bin."Block Movement"::" ") then
_IncludeInOrderList := false;
end;
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...