Quantcast
Channel: Dynamics User Group
Viewing all articles
Browse latest Browse all 15740

AX2012 R2: Runtime lookup with multiple table

$
0
0

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:

 

(Please visit the site to view this media)

 

-----------

to sum this thing up,

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

2. The name must be filterable.

 

 

 

 


Viewing all articles
Browse latest Browse all 15740

Trending Articles