use view in look up in ax 2012
1. create a view
2. create a query , if you want range/filter add datasource to prarent datasource
3. in look up
Client static void lookup(FormStringControl _ctrl )
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(CustomerView),_ctrl);
Query query = new Query(queryStr(SWS_CTMCustomerViewQ));
query.dataSourceTable(tablenum(CustTable)).addRange(fieldnum(CustTable,InventSiteId)).value(xyz);
sysTableLookup.addLookupfield(fieldnum(CustomerView, AccountNum));
sysTableLookup.addLookupfield(fieldNum(CustomerView, Name));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
1. create a view
2. create a query , if you want range/filter add datasource to prarent datasource
3. in look up
Client static void lookup(FormStringControl _ctrl )
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(CustomerView),_ctrl);
Query query = new Query(queryStr(SWS_CTMCustomerViewQ));
query.dataSourceTable(tablenum(CustTable)).addRange(fieldnum(CustTable,InventSiteId)).value(xyz);
sysTableLookup.addLookupfield(fieldnum(CustomerView, AccountNum));
sysTableLookup.addLookupfield(fieldNum(CustomerView, Name));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
No comments:
Post a Comment