In Dynamics Ax I can use sysTableLookup
to show a combo lookup with a grid with multiple columns?
How to get data from multiple table?
In Dynamics Ax I can use sysTableLookup
to show a combo lookup with a grid with multiple columns?
How to get data from multiple table?
You can join to other tables in your query, see below example from Axaptapedia
public void lookup()
{
Query query = new Query();
QueryBuildDataSource dsCustTable;
QueryBuildDataSource dsCustTrans;
// Instantiate sysTableLookup object using table which will provide the visible fields
SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(CustTable), this);
;
// Create the query. Only select customers where blocked != All and one more more transactions
// exist with no closed date
dsCustTable = query.addDataSource(tableNum(CustTable));
dsCustTable.addRange(fieldNum(CustTable, Blocked)).value(queryNotValue(CustVendorBlocked::All));
dsCustTrans = dsCustTable.addDataSource(tableNum(CustTrans));
dsCustTrans.relations(true);
dsCustTrans.joinMode(JoinMode::ExistsJoin);
dsCustTrans.addRange(fieldNum(CustTrans, Closed)).value(queryValue(dateNull()));
// Set the query to be used by the lookup form
sysTableLookup.parmQuery(query);
// Specify the fields to show in the form. In this case we have chosen
// Account number, name, and dimension one.
sysTableLookup.addLookupfield(fieldNum(CustTable, AccountNum));
sysTableLookup.addLookupfield(fieldId2Ext(fieldNum(CustTable, Dimension), 1));
// Perform the lookup
sysTableLookup.performFormLookup();
}
You can use display methods in your lookup pulling data from other tables.
Or you can use this extension: http://kashperuk.blogspot.co.uk/2008/09/sysmultitableloookup-dynamic-lookups.html