Use this event to
Excerpt |
---|
Filter Production Order Lines to be displayed at the mobile device. |
...
With this event you can perform basic record filtering of Orders Lines.
See also: TODO
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS MoveMOB WMS Production Consumption", 'OnGetMoveOrdersOnGetProdOrderLines_OnSetFilterWarehouseActivityOnSetFilterProductionOrder', '', true, true)]
local procedure OnGetMoveOrders OnGetProdOrderLines_OnSetFilterWarehouseActivityOnSetFilterProductionOrder(_HeaderFilter: Record "MOB NS Request Element"; var _IsHandledProdOrderLine: BooleanRecord "Prod. Order Line"; var _WhseActivityHeaderProductionOrder: Record "Warehouse Activity HeaderProduction Order"; var _WhseActivityLineIsHandled: Record "Warehouse Activity Line"Boolean)
begin
end;
Example
// [Example] Display all production orders instead of empty list if StartingDate-filter excludes everything
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS MoveMOB WMS Production Consumption", 'OnGetMoveOrdersOnGetProdOrderLines_OnSetFilterWarehouseActivityOnSetFilterProductionOrder', '', true, true)]
local procedure OnGetMoveOrders MyOnGetProdOrderLines_OnSetFilterWarehouseActivityOnSetFilterProductionOrder(_HeaderFilter: Record "MOB NS Request Element"; var _IsHandledProdOrderLine: Boolean Record "Prod. Order Line"; var _WhseActivityHeaderProductionOrder: Record "Warehouse Activity HeaderProduction Order"; var _WhseActivityLineIsHandled: Record "Warehouse Activity Line"Boolean)
begin
// [Scenario] Exclude orders with Assignment Date different than today if location is "MyLocation"var
StartingDate: Date;
begin
if _HeaderFilter.Name = 'LocationStartingDate' then
if begin
StartingDate := _HeaderFilter."Value" IN ['MyLocation'] GetValueAsDate();
if StartingDate <> 0D then
_WhseActivityHeaderProdOrderLine.SetFilter("Assignment DateStarting Date-Time", '=%1<%1', WorkDate( CreateDateTime(StartingDate + 1, 0T));
// Don't handle the filter, we still want the standard Location filter to be set.
end;
Example 2: Add custom filters to Standard headers
You want to add an additional filter to a existing header. if _ProdOrderLine.IsEmpty() then
_ProdOrderLine.SetRange("Starting Date-Time");
_IsHandled := true;
end;
end;
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...