sysTableLookup.addLookupMethod(tablemethodstr(CustTable,Name));
The purpose of this blog is for knowledge sharing and connect the relevant audience who are all into Microsoft Dynamics world.
Alfasith AX
Monday, July 15, 2013
Lookup() in Dynamic AX
Right click on the field method and override the lookup method in for that stringedit method.
public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(custTable), this);
sysTableLookup.addLookupField(fieldNum(CustTable, AccountNum));
sysTableLookup.addLookupMethod(tablemethodstr(CustTable,Name));
queryBuildDataSource = query.addDataSource(tableNum(CustTable));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, AccountNum));
queryBuildRange.value();
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
//super();
}
/// Another method////
public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(custTable), this);
sysTableLookup.addLookupField(fieldNum(CustTable, AccountNum));
sysTableLookup.addLookupMethod(tablemethodstr(CustTable,Name));
queryBuildDataSource = query.addDataSource(tableNum(CustTable));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, AccountNum));
queryBuildRange.value();
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
//super();
}
/// Another method////
public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(custTable), this); sysTableLookup.addLookupField(fieldNum(CustTable, AccountNum)); sysTableLookup.addLookupField(fieldNum(CustTable, CustGroup)); queryBuildDataSource = query.addDataSource(tableNum(CustTable)); queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, CustGroup)); queryBuildRange.value('40'); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); //super(); }
Subscribe to:
Posts (Atom)
SQL code to upate one Legal entity banner to all the legal entity in D365
Hi, update companyimage set companyimage.Image = companyimageA.Image from ( select Image from companyimage where dataAreaid = 'USF...
-
Hi, AccountingDistribution ( accounting distribution 7452 ) AccountingDistributionEventTmp ( accounting distribution 100001 ) Accountin...
-
Hi, Create a EDT name it Gender then in properties enumType : //select the enum name Use the below code and enjoy. static v...