Versions Compared

Key

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

Use this event to

Excerpt
Change sort order for <LookupResponse>-elements at the mobile device.



See alsoFilter or Sort Orders: How-to: Sorting of Orders (OnAfterSetFrom-events)

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnAnyLookupType_OnAfterSetCurrentKey''', true, true)]
    local procedure OnLookupOnAnyLookupType_OnAfterSetCurrentKey(_LookupType: Textvar _LookupResponseElementView: Record "MOB NS WhseInquery Element")
    begin
    end;

Example

    // [Example]  Sort response by Item.Name (="DisplayLine2" in response)
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Lookup", 'OnLookupOnAnyLookupType_OnAfterSetCurrentKey''', true, true)]
    local procedure MyOnLookupOnAnyLookupType_OnAfterSetCurrentKey(_LookupType: Textvar _LookupResponseElementView: Record "MOB NS WhseInquery Element")
    var
        MobWmsLookup: Codeunit "MOB WMS Lookup";
    begin
        if _LookupType = MobWmsLookup."CONST::BinContent"() then
            _LookupResponseElementView.SetCurrentKey(DisplayLine2)// DisplayLine2 is Item.Name in this LookupBinContent reponse
    end;

Version History

VersionChanges
MOB5.22Introduced

...