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

Use this event to

Modify existing response for online search 'ItemSearch' (values transferred from "Item" table).


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>
          <Bin>S-01-0001</Bin>
          <LookupType>BinContent</LookupType>
     </requestData>
</request>

Template

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Online Search", 'OnSearchOnItemSearch_OnAfterSetFromItem', '', true, true)]
    local procedure OnSearchOnItemSearch_OnAfterSetFromItem(_Item: Record Item; var _SearchResponseElement: Record "MOB NS WhseInquery Element")
    begin
    end;

Example

    // [Example]  Display "No. 2" in search response
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Online Search", 'OnSearchOnItemSearch_OnAfterSetFromItem', '', true, true)]
    local procedure MyOnSearchOnItemSearch_OnAfterSetFromItem(_Item: Record Item; var _SearchResponseElement: Record "MOB NS WhseInquery Element")
    var
        MobToolbox: Codeunit "MOB Toolbox";
    begin
        // Display "No. 2" as part of DisplayLine1 if populated
        if _Item."No. 2" <> '' then
            _SearchResponseElement.Set_DisplayLine1(_SearchResponseElement.Get_DisplayLine1() + MobToolbox.CRLFSeparator() + _Item."No. 2");
    end;

Version History

VersionChanges
MOB5.43Introduced
  • No labels