0

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?

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
stighy
  • 7,260
  • 25
  • 97
  • 157

2 Answers2

0

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();
}
AnthonyBlake
  • 2,334
  • 1
  • 25
  • 39
0

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

10p
  • 5,488
  • 22
  • 30