Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

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

...

Use this event to

Excerpt
Modify response elements for Item Inventory quantity. (Location Not using Bins).


Description

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

One or more Item- and ItemVariant-records is read based on the lookup request. This event is called for each Item/Variant-combination to populate separate _LookupResponseElement's for each combination.


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 LookupMOB WMS Lookup", 'OnLookupOnLocateItem_OnAfterSetFromItem''', true true, true true)]
    local procedure OnLookupOnLocateItem_OnAfterSetFromItem(_Item: Record Item; _ItemVariant: Record "Item VariantItem Variant"; var _LookupResponseElement: Record "MOB NS WhseInquery ElementMOB NS WhseInquery Element")
    begin
    end;

Example

...

01 - Add a custom response element 

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

...

'OnLocateItemOnAfterSetFromItem Custom Tag for Warehouse Class Code ' + _Item."Warehouse Class Code");
    end;


Example 02 - Add a custom response element as HTML

    // WhseInquiry-response as html view (requires Android 1.4.3 or newer)
    // 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)]
    local procedure My02OnLookupOnLocateItem_OnAfterSetFromItem(_Item: Record Item; _ItemVariant: Record "Item Variant"; var _LookupResponseElement: Record "MOB NS WhseInquery Element")
    begin
        _LookupResponseElement.Set_html(
            '<b><font color="blue">' + _LookupResponseElement.Get_DisplayLine1() '</font></b>' +
            '<br>' + _LookupResponseElement.Get_DisplayLine2() +
            '<br>' + 'Qty: ' + _LookupResponseElement.Get_Quantity());
    end;


Image Added

Filter by label (Content by label)
showLabelsfalse
max20
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
excludeCurrenttrue
cqllabel = "bc" and label = "onaftersetfrom" and label = "example" and label = "lookup"


Version History

VersionChanges
MOB5.00Introduced
MOB5.16New support for Set_html