Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Use this event to

Filter Transfer Orders to be displayed at the mobile device.

More complex filtering

This event provides only basic filtering.

More complex filtering can be performed using OnInclude


Template

[EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnSetFilterTransferOrder''', true, true)]
procedure OnGetReceiveOrders_OnSetFilterTransferOrder(_HeaderFilter: Record "MOB NS Request Element"; var _TransferHeader: Record "Transfer Header"; var _TransferLine: Record "Transfer Line"; var _IsHandled: Boolean)
begin
end;


 See event parameters
  • _HeaderFilter.Name: 
  • _HeaderFilter.Value: 
    • The filter value collected from the mobile user. 
    • Use or Modify this value for filtering.

  • _WhseReceiptHeader: 
    • Resulting filtering set of Orders.
    • Apply filters to affect the resulting OrderList.

  • _WhseReceiptLine:
    • Resulting filtering set of Order Lines.
    • Apply filters to affect the resulting OrderList.
      • Line filters also affects which Order are included.
      • Empty lines = the order is not relevant.
  • _IsHandled:
    • Use this to decide whether the Standard code should continue to apply the filter as normal.
    • You might want to Piggyback on a standard filter OR Overrule it.


Example 1:

// [Example]
[EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Receive", 'OnGetReceiveOrders_OnSetFilterTransferOrder''', true, true)]
procedure MyOnGetReceiveOrders_OnSetFilterTransferOrder(_HeaderFilter: Record "MOB NS Request Element"; var _TransferHeader: Record "Transfer Header"; var _TransferLine: Record "Transfer Line"; var _IsHandled: Boolean)
begin
    // [Scenario] Overrule the standard "Expected Receipt Date" filter
    // [Scenario] so document receipt date has to be the Exact specific date the user selects
    // [Scenario] Handle the filter, so standard filter is overruled.


    if _HeaderFilter.Name = 'Date' then begin
        if _HeaderFilter.GetValueAsDate() <> Today() then   // Remember to check if filter is different than today, meaning the user edited it
            _TransferHeader.SetFilter("Receipt Date", '=%1', _HeaderFilter.GetValueAsDate());
        _IsHandled := true;     // Handle the filter, so standard filter is overruled.
    end;
 end;



Example 2: Add custom filters to Standard headers

I.e. you want to add an additional filter to a existing header.

It is currently not supported to add new custom filter fields to existing standard headers. This will be supported in 2020.

A workaround is to use:How-to: Create custom Orders header


Example 3: Handle custom header filter

See How-to: Create custom Orders header



More examples


Version History

VersionChanges
MOB5.10Introduced



  • No labels