Versions Compared

Key

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

Use this event to

Excerpt

Add filter conditions for Warehouse Receipt Headers that cannot be solved by OnSetFilter-event.

 

Description

This event is triggered after filters have been applied to the Warehouse Receipt Header. The procedure  The event should be used only when it 's is not possible to determine from filters use OnSetFilter-event to solve if the Header should be included in the Order List ResponseOrderList response.

You can use the event to control if the The Warehouse Receipt Header should can be included in the Order List excluded from the OrderList response by setting the parameter _IncludeInOrderList to false.

Learn about Basic vs. Complex filtering


Template  

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader''', true, true)]
    local procedure OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader(_WhseReceiptHeader: Record "Warehouse Receipt Header";   var _HeaderFilters: Record "MOB NS Request Element"; var _IncludeInOrderList: Boolean)
    begin
    end;


Example

...

    // [Example]: Do not include in order list if Vendor is blocked.
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader''', true, true)]
    local procedure MyOnGetReceiveOrders_OnIncludeWarehouseReceiptHeader(_WhseReceiptHeader: Record "Warehouse Receipt Header";   var _HeaderFilters: Record "MOB NS Request Element"; var _IncludeInOrderList: Boolean)
    var
        WhseReceiptLine: Record "Warehouse Receipt Line";
        PurchaseHeader: Record "Purchase Header";
        Vendor: Record Vendor;
    begin
        // Loop lines belonging to this, current Receipt
        WhseReceiptLine.SetFilter("No.", _WhseReceiptHeader."No.");
        if WhseReceiptLine.FindSet() then
            repeat
                if WhseReceiptLine."Source Document" = WhseReceiptLine."Source Document"::"Purchase Order" then begin
                    PurchaseHeader.Get(WhseReceiptLine."Source Subtype", WhseReceiptLine."Source No.");
                    // Exclude the Receipt if Vendor is blocked
                    if Vendor.Get(PurchaseHeader."Buy-from Vendor No.") and not  and (Vendor.Blocked < VendorBlocked <> Vendor.Blocked::All" "then
                        _IncludeInOrderList := false;
                end;
            until (WhseReceiptLine.Next() 0) or not _IncludeInOrderList;
    end;



Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "orders" and label = "example" and label = "oninclude"


Version History

VersionChanges
MOB5.13Introduced