Use this event to
...
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader', '', true, true)]
procedure OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader(_WhseReceiptHeader: Record "Warehouse Receipt Header"; var _IncludeInOrderList: Boolean)
begin
end;
Example
// [Example]:
...
Do not include in order list if Vendor is blocked.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader', '', true, true)]
procedure OnGetReceiveOrders_OnIncludeWarehouseReceiptHeader(_WhseReceiptHeader: Record "Warehouse Receipt Header"; var _IncludeInOrderList: Boolean)
var
WhseReceiptLine: Record "Warehouse Receipt Line";
PurchaseHeader: Record "Purchase Header";
Vendor: Record Vendor;
begin
// Loop filtered Receipts
if _WhseReceiptHeader.FindSet() then
repeat
// Loop lines
WhseReceiptLine 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 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; until _WhseReceiptHeader.Next() = 0;
end;
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...