Use this event to
Excerpt |
---|
Filter Production Consumption Lines to be displayed at the mobile device. |
...
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLinesOnGetProdConsumptionLines_OnSetFilterProdOrderLineOnSetFilterProdOrderComponent', '', true, true)]
local procedure OnGetProdOrderLines OnOnGetProdConsumptionLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; OnSetFilterProdOrderComponent(var _ProdOrderLineProdOrderComponent: Record "Prod. Order Line"; var _ProductionOrder: Record "Production Order"; var _IsHandled: Boolean Order Component")
begin
end;
Example
// [Example] Display all production orders instead of empty list if StartingDate-filter excludes everything
//
// Hide components if they require picking but nothing is picked yet (partially or fully)
// Will show warning at Mobile Device if the list empty
//
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLinesOnGetProdConsumptionLines_OnSetFilterProdOrderLineOnSetFilterProdOrderComponent', '', true, true)]
local procedure MyOnGetProdOrderLines MyOnGetProdConsumptionLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; OnSetFilterProdOrderComponent(var _ProdOrderLineProdOrderComponent: Record "Prod. Order Line"; var _ProductionOrder Order Component")
var
Location: Record Location;
ProdOrderLine: Record "Production OrderProd. Order Line"; var _IsHandled
RequirePicking: Boolean)
var
StartingDate: Date;
begin
if _HeaderFilter.Name = 'StartingDateProdOrderComponent."Location Code" <> '' then begin
StartingDate RequirePicking := _HeaderFilterLocation.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;
endRequirePicking(_ProdOrderComponent."Location Code")
else begin
ProdOrderLine.Get(_ProdOrderComponent.Status, _ProdOrderComponent."Prod. Order No.", _ProdOrderComponent."Prod. Order Line No.");
RequirePicking := Location.RequirePicking(ProdOrderLine."Location Code")
end;
if RequirePicking then
_ProdOrderComponent.SetFilter("Qty. Picked", '<>0');
end;
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...