Skip to main content

Posts

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

Call SSRS Report through controller class in ax 2012

To Call SSRS Report through controller class  Go to main method in controller class and write below code to call the report. SSRSRPTController controller; controller = new SSRSRPTController(); controller.parmArgs(args); controller.parmReportName(ssrsReportStr(TestReport, report)); controller.parmShowDialog(true); controller.startOperation()

Call SSRS Repart class and Table data through Job in Ax 2012

To SSRS Repart class and Table data through Job in Ax 2012 you can try below code. TestTmp tempTable; TestDP dataProvider = new TestDP(); TestContract contract = new TestContract(); contract.parmCustAccount("Test00001"); contract.parmNofSample(8); dataProvider.parmDataContract(contract); dataProvider.processReport(); tempTable = dataProvider.getTestTmp(); while select tempTable { info(strFmt("%1,%2,%3,%4",tempTable.CurrencyCode,tempTable.SalesId,tempTable.Monthname,tempTable.CurrentMonthSum)); } Here TestDP is data provider class for SSRS Report and TestContract is contract class . To pass parameter value we used parmCustAccount and parmNofSample method from contract class. tempTable is temparary table used in DP class.

How to get Country Name by Country code for Sales order in Ax 2012

To  get Country Name by Country code for Sales order in Ax 2012 you can try below code. LogisticsAddressCountryRegionTranslation::find (LogisticsPostalAddress::findRecId (salesTable.DeliveryPostalAddress).CountryRegionId,'EN-US').ShortName Like code is SAU then if you want to display name of SAU as Saudi Arabia then you need to find it from LogisticsAddressCountryRegionTranslation table .