Versions Compared

Key

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

Use this event to

...

For performance reasons this event should be used only when it is not possible to use OnLookupOnLocateItemOnLookupOnPostShipment_OnSetFilterBinContentOnSetFilterWarehouseShipment-event.

Template    

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnPostShipment_OnIncludeWarehouseShipment''', true, true)]
    local procedure OnLookupOnPostShipment_OnIncludeWarehouseShipment(_WhseShipmentHeader: Record "Warehouse Shipment Header"; var _IncludeInLookup: Boolean)
    begin
    end;


Example

    // [Example]: Do not include in lookup response if Customer is blocked
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnPostShipment_OnIncludeWarehouseShipment''', true, true)]
    local procedure MyOnLookupOnPostShipment_OnIncludeWarehouseShipment(_WhseShipmentHeader: Record "Warehouse Shipment Header"; var _IncludeInLookup: Boolean)
    var
        WhseShipmentLine: Record "Warehouse Shipment Line";
        SalesHeader: Record "Sales Header";
        Customer: Record Customer;
    begin
        // Loop lines
        WhseShipmentLine.SetFilter("No.", _WhseShipmentHeader."No.");
        if WhseShipmentLine.FindSet() then
            repeat
                if WhseShipmentLine."Source Document" = WhseShipmentLine."Source Document"::"Sales Order" then begin
                    SalesHeader.Get(WhseShipmentLine."Source Subtype", WhseShipmentLine."Source No.");
                    // Exclude the Shipment if Customer is blocked
                    if Customer.Get(SalesHeader."Sell-to Customer No.") and (Customer.Blocked <> Customer.Blocked::" "then
                        _IncludeInLookup := false;
                end;
            until (WhseShipmentLine.Next() 0) or not _IncludeInLookup;
    end;


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

...