Use this event to
...
With this event you can perform basic record filtering of Orders.
, consider OnGetReceiveOrders_OnInclude... instead.
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnSetFilterPurchaseOrder', '', true, true)]
procedure OnGetReceiveOrders_OnSetFilterPurchaseOrder(_HeaderFilter: Record "MOB NS Request Element"; var _PurchHeader: Record "Purchase Header"; var _PurchLine: Record "Purchase Line"; var _IsHandled: Boolean)
begin
end;
Example 1: Modify standard header filter
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnSetFilterPurchaseOrder', '', true, true)]
procedure OnGetReceiveOrders_OnSetFilterPurchaseOrder(_HeaderFilter: Record "MOB NS Request Element"; var _PurchHeader: Record "Purchase Header"; var _PurchLine: Record "Purchase Line"; var _IsHandled: Boolean)
var
PurchaseHeader: Record "Purchase Header";
begin
// [Scenario] Validate the standard "Purchase Order" filter,
// [Scenario] by checking the order is Open.
// [Scenario] If not, abort process and force user to change filter with an error message
// [Scenario] Dont handle the filter, so standard filter works are normal
if _HeaderFilter.Name = 'PurchaseOrderNumber' then
if PurchaseHeader.Get(PurchaseHeader."Document Type"::"Order", _HeaderFilter."Value") and (PurchaseHeader.Status <> PurchaseHeader.Status::Released) then
Error('Purchase Order %1 is not released', PurchaseHeader."No.");
end;
Example 2: Add custom filters to Standard headers
...
Example 3: Handle custom header filter
See (Legacy) How-to: Create header Pre v5.14
Filter by label (Content by label) showLabels false showSpace false sort title title More examples excerptType simple cql label = "bc" and label = "orders" and label = "example" and label = "onsetfilter"
...