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 6 Next »

Use this event to

Set custom "lookup LocateItem" values for <LookupResponse>-elements derived from Item.


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>BLUE</Location>
          <ItemNumber>1928-S</ItemNumber>
          <LookupType>LocateItem</LookupType>
     </requestData>
</request>

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnLocateItem_OnAfterSetFromItem''', true, true)]
    procedure OnLookupOnLocateItem_OnAfterSetFromItem(_Item: Record Item; _ItemVariant: Record "Item Variant"; var _LookupResponseElement: Record "MOB NS WhseInquery Element")
    begin
    end;

Example 01 

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnLocateItem_OnAfterSetFromItem''', true, true)]
    procedure MyOnLookupOnLocateItem_OnAfterSetFromItem(_Item: Record Item; _ItemVariant: Record "Item Variant"; var _LookupResponseElement: Record "MOB NS WhseInquery Element")
    begin
        with _LookupResponseElement do begin
            Set_DisplayLine1('Set from OnLocateItemOnAfterSetFromItem');
            SetValue('WarehouseClassCode''OnLocateItemOnAfterSetFromItem Custom Tag for Warehouse Class Code ' + _Item."Warehouse Class Code");
        end;
    end;


Example 02

    // WhseInquiry-response as html view
    // NOTE: only first LookupResponse is displayed, do NOT use for Inquiries that may return multiple LookupResponse-elements)
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnLocateItem_OnAfterSetFromItem''', true, true)]
    procedure My02OnLookupOnLocateItem_OnAfterSetFromItem(_Item: Record Item; _ItemVariant: Record "Item Variant"; var _LookupResponseElement: Record "MOB NS WhseInquery Element")
    begin
        with _LookupResponseElement do
            Set_html(
                '<b><font color="blue">' + Get_DisplayLine1() '</font></b>' +
                '<br>' + Get_DisplayLine2() +
                '<br>' + 'Qty: ' + Get_Quantity());
    end;




Version History

VersionChanges
MOB5.00Introduced
MOB5.16New support for Set_html
  • No labels