Posts

Showing posts with the label sysTableLookup

Custom lookup in AX 2012

Image
Dear Friends, Today, in this post we are going to share how you can add custom lookup in your form control in AX 2012. Let's start... 1) In the AOT, expand Forms, expand the form, expand Designs, right-click Design. Add or drag a new control in the design section of form. Example : You can drag a string field from your form data source. 2) Expand the control on which you want to add the custom lookup, right-click Methods, click Override method, and then click lookup. The lookup method opens in the code editor. 3) Copy paste the below code. 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(CustT...