Versions Compared

Key

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

Use this event to

Excerpt
Set custom values On "Locate Item" for <LookupResponse>-elements derived from Bin Content

Modify response elements for Bin quantity.


Description

This event only affects locations with Location."Bin Mandatory" = true.

One or more BinContent-records is read based on the lookup request. This event is called for each BinContent to populate separate _LookupResponseElement's for each BinContent.


Sample request

<request name="Lookup" created="2019-08-14T10:39:46+02:00" xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Request">
     <requestData name="Lookup">
          <Location>SILVER</Location>
          <ItemNumber>1928-S</ItemNumber>
          <LookupType>LocateItem</LookupType>
     </requestData>
</request>

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS LookupMOB WMS Lookup", 'OnLookupOnLocateItem_OnAfterSetFromBinContent''', true true, true true)]
    local procedure OnLookupOnLocateItem_OnAfterSetFromBinContent(_BinContent: Record "Bin ContentBin Content"; var _LookupResponseElement: Record "MOB NS WhseInquery ElementMOB NS WhseInquery Element")
    begin
    end;


Example - Add a custom response element 

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS LookupMOB WMS Lookup", 'OnLookupOnLocateItem_OnAfterSetFromBinContent''', true true, true true)]
    local procedure OnLookupOnLocateItem MyOnLookupOnLocateItem_OnAfterSetFromBinContent(_BinContent: Record "Bin ContentBin Content"; var _LookupResponseElement: Record "MOB NS WhseInquery ElementMOB NS WhseInquery Element")
    begin
     with _LookupResponseElement do begin
                  _LookupResponseElement.Set_DisplayLine1('Set from OnLocateItemOnAfterSetFromBinContentSet from OnLocateItemOnAfterSetFromBinContent');
                  _LookupResponseElement.SetValue('WarehouseClassCode''OnLocateItemOnAfterSetFromBinContent Custom Tag for Warehouse Class Code OnLocateItemOnAfterSetFromBinContent Custom Tag for Warehouse Class Code ' + _BinContent."Warehouse Class CodeWarehouse Class Code");
     end;
    end;


Version History

VersionChanges
MOB5.00Introduced