Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use this event to

...

Affects which Production Consumption Lines are displayed (lines from Prod. Order Component table).
With this event you can perform basic record filtering.

See also: OnGetProdOrderLinesOnGetProdConsumptionLines_OnIncludeProdOrderLineOnIncludeProdOrderComponent

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLinesOnGetProdConsumptionLines_OnSetFilterProdOrderLineOnSetFilterProdOrderComponent''', true, true)]
    local procedure OnGetProdOrderLines OnOnGetProdConsumptionLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; OnSetFilterProdOrderComponent(var _ProdOrderLineProdOrderComponentRecord "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::CodeunitCodeunit::"MOB WMS Production Consumption", 'OnGetProdOrderLinesOnGetProdConsumptionLines_OnSetFilterProdOrderLineOnSetFilterProdOrderComponent''', true, true)]
    local procedure MyOnGetProdOrderLines MyOnGetProdConsumptionLines_OnSetFilterProdOrderLine(_HeaderFilter: Record "MOB NS Request Element"; OnSetFilterProdOrderComponent(var _ProdOrderLineProdOrderComponentRecord "Prod. Order Line"; var _ProductionOrder Order Component")
    var
        Location: Record Location;
        ProdOrderLineRecord "Production OrderProd. Order Line"; var _IsHandled
        RequirePickingBoolean)
    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)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "production" and label = "example" and label = "onsetfilter"

  

Version History

VersionChanges
MOB5.22Introduced