AX2012 R2: Runtime lookup with multiple table

I want to modify the lookup for ItemId in that the item name/product name must be included in the lookup. the thing is, the item name/product name should be filterable.

i have overridden the lookup method for the Item Id in my form. and have this code be executed:

 

public void lookup()

{

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

    Query                   query = new Query();

    QueryBuildDataSource    qbds2;

    QueryBuildDataSource    qbds3;

    QueryBuildDataSource    queryBuildDataSource = query.addDataSource(tableNum(InventTable));

 

    qbds2   = queryBuildDataSource.addDataSource(tableNum(EcoResProductTranslation));

    qbds2.relations(true);

 

    sysTableLookup.addLookupfield(fieldNum(InventTable,ItemId));

    sysTableLookup.addLookupMethod(tableMethodStr(InventTable,itemGroupId));

    sysTableLookup.addLookupfield(fieldNum(InventTable,NameAlias));

    sysTableLookup.addLookupfield(fieldNum(InventTable,ItemType));

    sysTableLookup.addSelectionField(fieldNum(InventTable,Product));

 

    //sysTableLookup.addLookupfield(fieldNum(EcoResProductTranslation, Product));

    sysTableLookup.addLookupfield(fieldNum(EcoResProductTranslation, Name));

    sysTableLookup.addSelectionField(fieldNum(EcoResProductTranslation,Product));

 

    sysTableLookup.parmQuery(query);

    sysTableLookup.performFormLookup();

}

 

unfortunately, i ended up having this thing:

 

 

-----------

to sum this thing up,

1. i want to include the item name in the lookup.

2. The name must be filterable.

 

 

 

 

Related
Recommended