Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Use this event to

Add filter conditions for Production Order Lines that cannot be solved by OnSetFilter-event.

 Description

This event is triggered after filters have been applied to the Production Order Lines. The event should be used only when it is not possible to use OnSetFilter-event to solve if the Prod. Order Lines should be included in the OrderList response.

The Production Order Lines can be excluded from the OrderList response by setting the parameter _IncludeInOrderList to false.

See also: OnGetProdOrderLines_OnSetFilterProdOrderLine

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"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::CodeunitCodeunit::"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

VersionChanges
MOB5.22Introduced
  • No labels