Lookup From Two Tables

Hi ,I am Working in AX 2009 , I have a Doubt Regarding the lookup from Two Different Tables.

Example ,I have Two Tables,StudinfoBoys ,StudinfoGirls ,Both tables have field named as ROLLNO ,I want a Lookup that will show the RollNo from the two tables .

How can we achieve that ?

Thanks

md rhiyas

SysMultiTableLoookup - dynamic lookups based on multiple tables

Question moved to the Developer forum.

I hope this will help you.

public void lookup()

{

Query query = new Query();

QueryBuildDataSource qbds;

QueryBuildDataSource qbdsJoin;

SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(SalesLine), this);

;

qbds = query.addDataSource(tableNum(SalesLine));

// use query join, if other tables involved.

qbds.addRange(fieldNum(SalesLine, salesId)).value(SalesId.valueStr());

qbds.addRange(fieldNum(SalesLine, Ignlicenseplate)).value(licensePlate.valueStr());

qbds.addRange(fieldNum(SalesLine, ItemId)).value(ItemId.valueStr());

sysTableLookup.parmQuery(query);

sysTableLookup.addLookupfield(fieldnum(SalesLine,InventTransId));

sysTableLookup.addLookupfield(fieldnum(SalesLine,ItemId));

sysTableLookup.addLookupfield(fieldnum(SalesLine,PurchId));

sysTableLookup.addLookupfield(fieldnum(SalesLine,SalesQty));

sysTableLookup.addLookupfield(fieldnum(SalesLine,SalesUnit));

sysTableLookup.addLookupfield(fieldnum(SalesLine,SalesPrice));

sysTableLookup.addLookupfield(fieldnum(SalesLine,LineAmount));

sysTableLookup.performFormLookup();

}