Skip to main content

Posts

Showing posts from September, 2016

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 .

Hide dialog for SSRS Report in ax 2012

To Hide dialog for SSRS Report in ax 2012 you need to go to controller class and follow below steps. Go to Controller class then go to  main method of class. Find  statement : Controller.startOperation(); then specify the below statement to hide dialog box which used for range selection. Controller.parmShowDialog(false); To show dialog you can pass value true instead of false.

Code to call Display method in Workflow class in Ax 2012

If you want to show display method of table in workflow designer then you need to write method on table and class . For example table method to get customer credit limit value. display AmountMST Cust_CreditLimit() { ; return CustTable::find(this.CustAccount).CreditMax; } Then go to document class for e.j. \Classes\PurchTableDocument and create new method like this. public AmountMSTParmCreditLimit(CompanyId _companyId, TableId _tableId, RecId _recId) { CustTable CustTable; select CustTable where CustTable.recid==_recId; return CustTable.Cust_CreditLimit(); }