Skip to main content

Code to set range in lookup for SSRS Report in Ax 2012

This is sample Code to set range in lookup for SSRS Report in Ax 2012 in UI Builder class.

First create lookup method in this sample code EmpLookUp is method for lookup then using post build and build method you can get lookup with range.


 public void build()  
 {  
   contract              = this.dataContractObject();  
   dialogReportNatureofSaration    = this.addDialogField(methodStr(TestSummaryContract, parmModeofSeparation),contract);  
   dialogreportEmpCode         = this.addDialogField(methodStr(TestSummaryContract, parmEmpId),contract);  
   dialogreportEmpCode.value("");  
   dialogReportNatureofSaration.value("");  
 }  
 private void EmpLookUp(FormStringControl EmpLookUp)  
 {  
   Query          query = new Query();  
   QueryBuildDataSource  queryBuildDataSource;  
   QueryBuildDataSource  queryBuildDataSourceLocal;  
   QueryBuildRange     queryBuildRange;  
   SysTableLookup     sysTableLookup;  
   ;  
   {  
     sysTableLookup=SysTableLookup::newParameters(tablenum(TestTransactions),EmpLookUp);  
     sysTableLookup.addLookupfield(fieldnum(TestTransactions,EmplId));  
     queryBuildDataSourceLocal = query.addDataSource(tableNum(TestTransactions));  
     queryBuildDataSourceLocal.addRange(fieldNum(TestTransactions, EosTransType)).value(SysQuery::value(dialogReportNatureofSaration.value()));  
     sysTableLookup.parmQuery(query);  
     sysTableLookup.performFormLookup();  
   }  
 }  
 public void getFromDialog()  
 {  
   contract = this.dataContractObject();  
   super();  
 }  
 public void postBuild()  
 {  
   super();  
   dialogReportNatureofSaration  = this.bindInfo().getDialogField(this.dataContractObject(),methodStr(TestSummaryContract, parmModeofSeparation));  
   dialogreportEmpCode       = this.bindInfo().getDialogField(this.dataContractObject(),methodStr(TestSummaryContract, parmEmpId));  
   dialogreportEmpCode.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(TestSummaryUIBuilder,EmpLookUp), this);  
   dialogreportEmpCode.lookupButton(2);  
 }  

Popular posts from this blog

How to set up parent project in project accounting in ax 2012

create simple project and then go to the project hierarchy fast tab and there you must define sub-project ID format "-#" and then your sub-project will be enabled. For resource assigning in Project first you need to configure the HR module, in that you need to maintain the calendar for those employees and then you need to define the cost of that particular employee (for expense) and for Revenue you need to define the sales price of that particular employee. In the project accounting module you need to mention the calendar in scheduling fast tab and then you need to define WBS, in WBS activity you can be able to assign resources.

ERD Account Payable and Account Receivable in ax 2012