Skip to main content

Posts

Showing posts with the label SysTableLookup

Add custom Lookup for Employee id in Ax 2012

To Add customLookup for Employee id in Ax 2012 you can try below code sample in datasource filed of the form. You can add data method to lookup easily to get the name of the employee. Here HcmWorker is a master table of employee and personnel number and name is the field of Hcmworker table. SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(HcmWorker),_formControl); Query query = new Query(); QueryBuildDataSource queryBuildDataSource = query.addDataSource(tableNum(HcmWorker)); queryBuildDataSource.addRange(fieldnum(HcmWorker,Tester)).value(queryvalue(Noyes::Yes)); sysTableLookup.addLookupfield(fieldNum(HcmWorker,PersonnelNumber)); sysTableLookup.addLookupMethod(tableMethodStr(HcmWorker,Name)); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup();

Add Lookup Method for Dimension fields for UI Builder class in Axapta SSRS

To Add Lookup Method for Dimension fields like division ,branch etc using UI Builder class in Axapta SSRS Report you can refer below code. #define.DimensionName("Branch") Query query; QueryBuildDataSource qbds,qbds1; SysTableLookup sysTableLookup; DimensionAttribute dimAttr; ; dimAttr = DimensionAttribute::findByName(#DimensionName); sysTableLookup = SysTableLookup::newParameters(tablenum(OMOperatingUnit),branchCodeLookup); sysTableLookup.addLookupfield(fieldnum(OMOperatingUnit, OmoperatingunitNumber)); sysTableLookup.addLookupfield(fieldNum(OMOperatingUnit,Name)); query = new Query(); qbds = query.addDataSource(tableNum(OMOperatingUnit)); qbds.addRange(fieldNum(OMOperatingUnit, OMOperatingUnitType)).value(queryvalue(OMOperatingUnitType::OMBusinessUnit)); sysTableLookup.parmQuery(query); sysTableLookup.parmUseLookupValue(False); sysTableLookup.performFormLookup(); Division dime...

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::n...