In Dynamics AX one way you can add a custom lookup or drop down list to a
form control by overriding the lookup method of the control. Below is
some example code for doing this.
public void lookup() { SysTableLookup sysTableLookup = SysTableLookup::newParameters( tablenum(CustTable), this); Query query; QueryBuildDataSource queryBuildDataSource; ; sysTableLookup.addLookupfield( fieldnum(CustTable, AccountNum)); sysTableLookup.addLookupfield( fieldnum(CustTable, Name)); query = new Query(); // Add datasource to the query queryBuildDataSource = query.addDataSource( tablenum(CustTable));
queryBuildRange = queryBuildDataSource.addRange(
fieldNum(CustTable, AccountNum));
select firstonly AccountNum from custTable; queryBuildRange.value(queryRange(custTable.AccountNum, '')); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); }
Happy Daxing! :)
No comments:
Post a Comment