As we all know that we have extensively used SysTableLookup in older versions of AX to get the custom lookups. This class is still available in AX 2012.
But, in AX 2012 a new class SysFieldGroupLookup has been introduced which will help to get the lookup from the field groups of the table. This is a very useful feature as most of the fields to be added to the lookup fields can be reduced and can be pulled from the Table >> field groups directly.
Let me explain with an example.
Create a form as shown below with simple StringEdit control and set the lookup button property to “Always”
Override the lookup method of the control and add the below code
public void lookup()
Query oQuery = new Query();
oSysFieldGroupLookup = SysFieldGroupLookup::newParameters(tablenum(CustTable), this);
Save the changes. Open the form by using Ctrl + O. you will find that the lookup will show the fields/columns and data of all the customers from the field Group “salesOrder” of CustTable.
Try with different table and field groups. Nice feature. Lookup will also display the display/data methods in the field group.
Try with EPCreditInfo field group. I am looking into how to get the selected value of the data method in to calling control. No luck though. I don’t see any method to return to calling control the selected data method value.