Use this event to
Add filter conditions for Purchase Lines that cannot be solved by OnSetFilter-event.
Description
This event is triggered after filters have been applied to the Purhase Line. The event should be used only when it is not possible to use OnSetFilter-event to solve if the Line should be included in the OrderLines response.
You can use the event to control if the Purchase Line should be included in the Order Line response by setting the parameter _IncludeInOrderLines to false.
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrderLines_OnIncludePurchaseLine', '', true, true)]
procedure OnGetReceiveOrderLines_OnIncludePurchaseLine(_PurchLine: Record "Purchase Line"; var _IncludeInOrderLines: Boolean)
begin
end;
Example: Do not include items that are blocked
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrderLines_OnIncludePurchaseLine', '', true, true)]
procedure MyOnGetReceiveOrderLines_OnIncludePurchaseLine(_PurchLine: Record "Purchase Line"; var _IncludeInOrderLines: Boolean)
var
Item: Record Item;
begin
if Item.Get(_PurchLine."No.") and Item.Blocked then
_IncludeInOrderLines := false;
end;
More examples
-
How-to: Filter Order Lines — Examples of filtering Order Lines .
Version History
Version | Changes |
---|---|
MOB5.13 | Introduced |