web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Lookup with ItemId, ItemName, NameAlias and inventSerialId

(0) ShareShare
ReportReport
Posted on by 12,119 Moderator

Hi all,

I want ItemId, ItemName, NameAlias and inventSerialId in a lookup. How can I do this.?

Thank you

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Could you please explain your problem? Maybe you don't know how to create lookup at all. Maybe you don't know how to join the tables. Maybe you don't know how to return fields from several tables (and you're not aware of SysMultiTableLookup). Or maybe you have yet another problem...

  • Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Martin Dráb

    I know How to create lookup and how to join tables but do not know to return fields from several tables

    Thank you

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    I already gave you the keyword you need: SysMultiTableLookup. Here you'll find source code and a tutorial; use your favorite search engine of you need more examples.

  • Verified answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Martin Dráb

    I use you link to download SysMultiTableLookup and write the following code in lookup of my field

    //super()

    Query                   query = new Query();

       QueryBuildDataSource    qbdsInventSum;

       QueryBuildDataSource    qbdsInventDim;

       QueryBuildDataSource    qbdsInventItemLocation;

       QueryBuildRange         qbrModuleType;

       SysMultiTableLookup     sysTableLookup;

       ;

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

       qbdsInventSum.addRange(fieldnum(InventSum, ItemId)).value(queryValue(ItemId.text()));

       qbdsInventSum.addRange(fieldNum(InventSum, Closed)).value(queryValue(NoYes::No));

       /*qbdsInventSum.addGroupByField(fieldnum(InventSum, ItemId));

       qbdsInventSum.addSelectionField(fieldNum(InventSum, ReservPhysical), SelectionField::Sum);

       qbdsInventSum.addSelectionField(fieldNum(InventSum, OnOrder), SelectionField::Sum);*/

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

       qbdsInventDim.relations(true);

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

       qbdsInventDim.joinMode(joinMode::InnerJoin);

       qbdsInventDim.addRange(fieldnum(InventDim, InventSiteId)).value(queryValue(Site.text()));

       qbdsInventDim.addRange(fieldnum(InventDim, InventlocationId)).value(queryValue(WareHouse.text()));

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

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

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

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

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

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

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

       sysTableLookup.performFormLookup();

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans