OnLookupOnPostShipment_OnSetFilterWarehouseShipment

Use this event to

Filter Warehouse Shipments to be displayed at the mobile device for lookup "OnPostShipment".

Description

This event is for filtering Warehouse Shipments in the special lookup page "OnPostShipment". Do not confuse with the the Shipment OrderList page (described in GetShipOrders).

If you wish to implement conditions that cannot be solved with this event you may subscribe OnLookupOnPostShipment_OnIncludeWarehouseShipment-event instead.

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnPostShipment_OnSetFilterWarehouseShipment''', true, true)]
    local procedure OnLookupOnPostShipment_OnSetFilterWarehouseShipment(var _RequestValues: Record "MOB NS Request Element"; var _WhseShipmentHeader: Record "Warehouse Shipment Header"; var _WhseShipmentLine: Record "Warehouse Shipment Line")
    begin
    end;


Example 1

    // [Example 01] Do not allow mobile user to handle shipments lines over a certain weight when no special equipment is used (but still ship remaining lines)
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnPostShipment_OnSetFilterWarehouseShipment''', true, true)]
    local procedure My01OnLookupOnPostShipment_OnSetFilterWarehouseShipment(var _RequestValues: Record "MOB NS Request Element"; var _WhseShipmentHeader: Record "Warehouse Shipment Header"; var _WhseShipmentLine: Record "Warehouse Shipment Line")
    var
        MyCustomEquipmentText: Text;
    begin
        MyCustomEquipmentText := _RequestValues.GetValue('MyCustomEquipmentField');   // New custom field in headerconfiguration used by the lookup page
        if MyCustomEquipmentText = 'No special equipment' then
            _WhseShipmentLine.SetRange(Weight, 025);
    end;

Example 2

    // [Example 02] Exclude Warehouse Shipments that has comments
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnPostShipment_OnSetFilterWarehouseShipment''', true, true)]
    local procedure My02OnLookupOnPostShipment_OnSetFilterWarehouseShipment(var _RequestValues: Record "MOB NS Request Element"; var _WhseShipmentHeader: Record "Warehouse Shipment Header"; var _WhseShipmentLine: Record "Warehouse Shipment Line")
    begin
        _WhseShipmentHeader.SetRange(Comment, false);
    end;


More examples

There are no items with the selected labels at this time.


Version History

Version

Changes

MOB5.21Introduced