Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Multi Select Lookup

(0) ShareShare
ReportReport
Posted on by 12,077 Super User 2024 Season 1

Hi all

I have Multi Select Lookup as shown below

8715.Untitled1.png

When I select from this lookup. It gets Item Number. But my problem is that I want configuration without any affect on this display order. Is there any way.?

Thank you

*This post is locked for comments

  • RE: Multi Select Lookup

    No, the SysTableLookup class is designed to return and populate the first column value into the control from which you invoked the lookup.

    It is not designed to return multiple values.

  • Abdul Wahab Profile Picture
    Abdul Wahab 12,077 Super User 2024 Season 1 on at
    RE: Multi Select Lookup

    Hi Ivan Kashperuk

    Is there any event record method from that I will get all the values.? or go to your suggestion is the only way?

    Thank you

  • RE: Multi Select Lookup

    Man, you keep changing your mind. So now you want not just config but all the fields.

    I suggest you create a lookup form (in AOT), that will make it much easier to control what is returned - with dynamically generated forms it's more difficult

  • RE: Multi Select Lookup

    Well, the easiest would be to swap the lookup fields.

      sysTableLookup.addLookupfield(fieldnum(InventDim, ConfigId), 2);

      sysTableLookup.addLookupfield(fieldnum(InventSum, ItemId), 1);

      sysTableLookup.addLookupfield(fieldnum(InventTable, ItemName), 3);

    Would that work for you?

    If not, it becomes much more difficult - you'll need to modify what control value is returned, and that ain't easy with the SysTableLookup as it's a dynamically generated form.

  • Abdul Wahab Profile Picture
    Abdul Wahab 12,077 Super User 2024 Season 1 on at
    RE: Multi Select Lookup

    Hi all

    I want to use all fields that are in this lookup. How may I go to use them all?

    Thank you

  • Abdul Wahab Profile Picture
    Abdul Wahab 12,077 Super User 2024 Season 1 on at
    RE: Multi Select Lookup

    Hi Ivan Kashperuk

    This is my whole code which I use in a lookup

    public void lookup()

    {

       //super();

       Query                   query = new Query();

       QueryBuildDataSource    qbdsInventSum, qbdsInventDim, qbdsInventTable;

       QueryBuildRange         qbrModuleType;

       SysMultiTableLookup     sysTableLookup;

       SysTableLookup          sysTableLookup1;

       ;

       qbdsInventSum = query.addDataSource(tableNum(InventSum));

       qbdsInventDim = qbdsInventSum.addDataSource(tableNum(InventDim));

       qbdsInventDim.relations(true);

       qbdsInventDim.addLink(fieldNum(InventSum, InventDimId), fieldNum(InventDim, InventDimId));

       qbdsInventDim.joinMode(joinMode::InnerJoin);

       qbdsInventTable = qbdsInventSum.addDataSource(tableNum(InventTable));

       qbdsInventTable.relations(true);

       qbdsInventTable.addLink(fieldNum(InventSum, ItemId), fieldNum(InventTable, ItemId));

       qbdsInventTable.joinMode(joinMode::InnerJoin);

       sysTableLookup = SysMultiTableLookup::newParameters(this, query);

       sysTableLookup1 = SysTableLookup::newParameters(tableNum(InventTable),this);

       sysTableLookup.addLookupfield(fieldnum(InventSum, ItemId), 1);

       sysTableLookup.addLookupfield(fieldnum(InventTable, ItemName), 3);

       sysTableLookup.addLookupfield(fieldnum(InventDim, ConfigId), 2);

       sysTableLookup.addLookupfield(fieldnum(InventDim, InventSiteId), 2);

       sysTableLookup.addLookupfield(fieldnum(InventDim, InventLocationId), 2);

       sysTableLookup.addLookupfield(fieldnum(InventDim, InventSerialId), 2);

       SysTableLookup.addLookupMethod(tableMethodStr(InventSum, netWeightOnHand),1,"Net weight");

       sysTableLookup.addLookupfield(fieldnum(InventSum, ReservPhysical), 1);

       SysTableLookup.addLookupMethod(tableMethodStr(InventSum, PhysicalInvent),1,"Physical Inventory");

       SysTableLookup.addLookupMethod(tableMethodStr(InventSum, AvailPhysical),1,"Available physica");

       sysTableLookup.addLookupMethod(tableMethodStr(InventSum, orderedSum), 1, "Ordered in total");

       sysTableLookup.addLookupMethod(tablemethodstr(InventSum, AvailOrdered), 1,"Ordered in total");

       sysTableLookup.addLookupfield(fieldnum(InventSum, OnOrder), 1);

       sysTableLookup.performFormLookup();

    }

    Thank you

  • Abdul Wahab Profile Picture
    Abdul Wahab 12,077 Super User 2024 Season 1 on at
    RE: Multi Select Lookup

    Hi all

    Is there anyway to do so. Please help me, If anyone knows related think

    Thank you

  • RE: Multi Select Lookup

    Can you show how you invoke the lookup? The code

  • Abdul Wahab Profile Picture
    Abdul Wahab 12,077 Super User 2024 Season 1 on at
    RE: Multi Select Lookup

    Hi Ivan Kashperuk

    This is my multi select lookup(sysMultiSelect class). Lookup is fine but when I select one record from it. It gives me 1st column in a lookup text box but I need 3rd one. Is there anyway to do that.? Is it clear to you.? Need something more

    Thank you

  • RE: Multi Select Lookup

    I am not sure I understood it right.

    But the standard lookup of Configuration/Size/Color/Style on, say, Sales order populates All the product dimensions depending on your selection in the lookup form - you check out that code and do the same?

    Your screenshot does not explain anything to be honest.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans