Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use this event to

Excerpt

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

Description

This event affects locations with Location."Bin Mandatory" = true.For locations with no Bin Content consider using the OnLookupOnLocateItem_OnIncludeItem-eventis 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 same conditions for locations with- and without BinContent you must subscribe to this event but also to OnLookupOnLocateItem_OnIncludeItem-eventconditions 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;


Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "lookup" and label = "locateitemonpostshipment" and label = "onsetfilter" and label = "example"


Version History

Version

Changes

MOB5.21Introduced