Skip to main content

Posts

Showing posts from 2016

Remove spaces from Text in Ax 2012

To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side . Dirpartytable Dirpartytable; Name Name; ; while select forUpdate Dirpartytable { ttsBegin; Name= strRTrim(strLTrim(Dirpartytable.Name)); Dirpartytable.Name = Name; Dirpartytable.doUpdate(); ttsCommit; } info("Done");

Cascade delete option in Ax 2012

Cascade delete option in Ax 2012 . You can apply as below image for your tables.

Update and Update_RecordSet Code sample in Ax 2012

This is Update and Update_RecordSet Code sample. Result of both will be same . TestTable TestTable; //Update_Recordset update_recordset TestTable setting Name ="New Enterprises" where TestTable.Accountnum =="uS-027"; //Update ttsBegin; while select forupdate TestTable where TestTable.Accountnum =="uS-027" { TestTable.Name ="New Enterprises"; TestTable.update(); } ttsCommit; info("OK");

List of Companies working in NAV and CRM in India

How to delete a company in Microsoft Management Reporter 2012

1.        Make a complete backup of your Management Reporter database in SQL. 2.        Start the Configuration Console. 3.        Under Management Reporter Services, click Companies. a.        Before you can delete a company, you must remove all associations with any tree or report definitions. 4.        Select the company that you want to delete. 5.        Click Delete Company.

Select Which ERP and why

1. Very small organization where other than accounts other departmental functions like sales-distribution, purchase, stores-inventory, production, fixed asset, supply chain , financial decision making is not that important they can carry on with TALLY or Tally ERP but who have such operation or will have in future should use Matured ERP like Dynamics Ax,SAP ,Infor etc. 2. Who have out grown with tally or tally ERP and don't want to waste time and money just by implementing cheap local ERP and cant's afford Branded ERP should go with domestic matured solution like NAVISION. 3. People should not choose ERP because of the product itself but choosing right vendor is more important as after implementation support ensures your investment was right or have gone wrong. 4. Branded ERP helps in building image of the company as well as to the users but the organization needs to change its way of operation as per the software which is not the case with Domestic Matured ERP where they map

How to Upload License in Microsoft Dynamics AX 2012

To Upload License in Microsoft Dynamics AX 2012  you need to  follow below steps. Go To System administration > Setup > Licensing > License information. Then Click Load license file to import the license codes from a file and select license file. Then Click on OK button. Then message will appear and asks whether you want to synchronize the database. Click Yes and complete the process.

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(); }

Code to get date time difference in ax 2012

This is a sample example to get date time difference in ax 2012 TransDateTime dateTime_a, dateTime_b; date date1, date2; int64 c; #define.NoOfHrsInADay(24); dateTime_a= 2014-09-26T11:59:59; dateTime_b= 2014-09-19T08:50:50; c = DateTimeUtil::getDifference(dateTime_a,dateTime_b); date1 = DateTimeUtil::date(dateTime_a); date2 = DateTimeUtil::date(dateTime_b); c = c - (date1-date2)*(#NoOfHrsInADay)*60*60; info(strFmt("%1 day, %2 hrs.",(date1-date2), c div 3600)); Output will be like this:-7 day, 3 hrs. I hope it will help you in your date  time troubleshooting.

Code to Create On Account Transaction for Project in Ax 2012

Path for On Account Transaction for Project is as below. Project management and accounting/Common/Projects/All projects/  On Account Transactions This is Code sample to Create On Account Transaction for Project in Ax 2012. You need to declare required variables. _ProjTable =ProjTable::find(_projId); projOnAccTrans.clear(); projOnAccTrans.ProjID = _projId; projOnAccTrans.TransDate = _str2Date("3/11/2015",123); projOnAccTrans.editTransactionOrigin(true,ProjOriginOnAcc::Milestone); projOnAccTrans.Description = _Description; projOnAccTrans.CurrencyId = _Currency; projOnAccTrans.TotalSalesAmountCur = _SalesPrice; projOnAccTrans.TransId = ProjParameters::newTransId(); projOnAccTrans.Qty=_Quantity; projOnAccTrans.DefaultDimension=_ProjTable.DefaultDimension; projOnAccTrans.projInvoiceStatus(); projOnAccTrans.insert

Finalization of Purchase order if PO is not in invoiced status Ax 2012

You can use following steps for Finalization of PO . Check the Status of the Purchase Order(PO) of Purchase Order is with approval status Confirmed & PO status ‘Invoiced’ than you can finalized directly but if its not invoiced then you can use below steps. You need to do change request for workflow Click on ‘Request Change’. Then Cancel the ‘Deliver Remainder’ for all the items in the Purchase Order. Then Submit the Purchase Order for Workflow approval. Then Make the Purchase Order ‘Approved’ Then Confirm the Purchase Order. After above step now you can Finalize the Purchase Order.

Number sequence gap issues for Orders in Ax 2012

Some time we noticed that there is Number sequence gap issues for Orders in Ax 2012 like you have created SO00001 then after sometimes you created then you got order SO00004 is creating instead of SO00002. Reason for this kind of issue is as follow. 1.If you check to number sequence type then you will find that a continuous number sequence could be setup as Order. 2. If you create a new order and then delete it, no numbers added to the status list which can be freed and used again system maintain itself. 3. If you create a new order using but then you cancel it for example "Create sales order" form, and click "cancel" in the form then the number will be added to the status list. Then the number can be freed by clean-up and can be used again when a new order is created. I hope you can get Idea from above observation.

Solved Error during Inventory Closing and Recalculation in Ax 2012

Getting following Error during Inventory Closing and Recalculation in Ax 2012. Error Details: "You can't have unallocated cost on a planning formula" Solution : This error may come many ways. First check the item in production type is formula or not, if not, change production type to formula. Then you can debug following method in class InventCostItemDim  \Classes\InventCostItemDim.addFormulaKeyAdjustment() To get any error due to rounding you can check ledgervouchertransobject class in checkrounding method. Then you can correct rounding issue. If still error exist then find the recid by debugging on error editing message and find that record in inventtrans table. If in inventtrans table valueopen field if its yes then select no this option you can use only if there is no other solution you found.

Get unit conversion value of item in Ax 2012

To Get unit conversion value of item in Ax 2012 you can use below code. UnitOfMeasureConverter_Product is a class which has different method to give you converted value. Here example is showing to get conversion value from liter to kilo gram. UnitOfMeasureConverter_Product unitConverter = UnitOfMeasureConverter_Product::construct(); unitConverter.parmProduct(InventTable::find("TestIte",true).Product); unitConverter.parmFromUnitOfMeasure(UnitOfMeasure::unitOfMeasureIdBySymbol("ltr")); unitConverter.parmToUnitOfMeasure(UnitOfMeasure::unitOfMeasureIdBySymbol("kg")); unitConverter.parmRoundAbsoluteValue(NoYes::Yes); unitConverter.parmApplyRounding(NoYes::Yes); info(strFmt("%1",unitConverter.convertValue(1)));

Run Dynamics Ax as different user on single machine

If you want to Run Dynamics Ax with different user on single machine then you need not to login as remote with different user you can run Ax with same login by following trick. Just press shift and then right click on dynamics Ax Icon then following option will show for login as different user. This will work only for original Ax Shortcut not Ax configuration file. If you want to do this trick with configuration file then you need to do below. First You need to create an AX32.exe shortcut that takes the config file as a parameter using properties option . Put below. C:\Program Files\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" -regconfig=C:\ConfigName.axc

Execute SSRS Report by code in Ax 2012

I want to share to Execute SSRS Report by code in Ax 2012. You can use below code to run report manually . You can try this code if you are not able to view your report due to some security issue. You can use controller class code to debug your report the get the cause. //version ax 2012 Code SrsReportRunController SRScontroller; SRScontroller= new SrsReportRunController(); SRScontroller.parmReportName(‘TestReport.ReportDesign1′); SRScontroller.runReport();

Create lookup Code on dimension field in Ax 2012

This code is to create lookup on dimension field like Business unit,department,division etc.You can add this code in your class ,form etc.There could be little bit  change in coding on  form for lookup. // FormStringControl control = dialog.formRun().controlCallingMethod(); SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(DimensionAttributeValue), control); Query query1 = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; DimensionAttribute dimAttr; ; dimAttr = DimensionAttribute::findByName("Department"); query1.addDataSource(tablenum(DimensionAttributeValue)).addRange(fieldNum(DimensionAttributeValue,DimensionAttribute)).value(queryValue(dimAttr.RecId)); sysTableLookup.addLookupMethod(tableMethodStr(DimensionAttributeValue, getname)); sysTableLookup.addLookupMethod(tableMethodStr(DimensionAttributeValue, getValue)); //this code is to add

Bank Account Reconciliation Error in Ax 2012

Getting below error on Bank Account Reconciliation in Ax 2012. Solution: The error given above generally comes when a manual entry is made in the Bank Reconciliation form. After checking data it was found that a manual entry has been done in one of the transactions for an amount xxxx. This requires ledger account in the Bank Transaction type.To correct this issue A journal voucher is required to be posted for the adjustment transaction of particular amount which is found as manual entry.

System admin cannot add or edit roles privileges duties Ax 2012

Problem: Issue is user sys admin not able add or edit and roles privileges duties etc its allowing from AOT but not from AX client. Solution: If you have Sys Admin and Sys User you should be able to make changes via System administration > Setup > Security but if you are still not able to do that then there may be something setting issue. After checking all setting at Ax found that Version control was enabled in the system so its not allowing to change roles privileges and duties  when Version control disabled then its working fine. Due to Version control enabled its being locked for change and its for security reason.

Table Replication Error on Synchronization in Ax 2012

Getting this error on data dictionary synchronization.. Error Synchronise database Cannot execute a data definition language command on  (). The SQL database has issued an error. Info Synchronise database SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot alter column 'VOUCHER' because it is 'REPLICATED'. Info Synchronise database SQL statement: ALTER TABLE "DBO".BANKCHEQUETABLE ALTER COLUMN VOUCHER nvarchar(30) NOT NULL Error Synchronise database Cannot execute a data definition language command on  (). The SQL database has issued an error. Info Synchronise database SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot alter column 'VOUCHER' because it is 'REPLICATED'. Info Synchronise database SQL statement: ALTER TABLE "DBO".BANKDEPOSIT ALTER COLUMN VOUCHER nvarchar(30) NOT NULL Error Synchronise database Cannot execute a data definition languag

Purchase order Budget validation Error in Ax 2012

Problem: Purchase order Budget validation Error in Ax 2012 coming during purchase invoice . This PO is previous year purchase order on which period is stopped/closed. "The accounting date for the invoice must be in the same fiscal year as the related purchased order. Run the purchase order year-end process or change the date to the current fiscal year" Solution: Check the option in below menu. Go to budgeting -Setup->Budget control->Budget control configuration and make changes in projectsourcedoucuemntlineitemHelper class of projTranstype method by comparing class at Hotfix Ax 2012 R2 KB2921204

Workflow stopped Error after submission for approval in Ax 2012

Problem . I faced this error Workflow stopped Error after submission for approval in Ax 2012. The items are Purchased, Received or Registered. Quantity ordered cannot be reduced because there are not enough open stock transactions with the ordered status. Observation My observation is as below When I am create new Purchase order and purchase order is in invoiced status but 2 qty is in cancel mode then purchase order getting approved but for old order its give above error. After investigation on google and other sites I did not get anything so finally I did approved workflow from back end activity. I hope some people who is smart they will give answer to me on this query. After some days I get same error again then I assigned admin rights to approval user then its getting approved.

IDMF Posting error on starting for Ax 2012 windows 8 r2

This topic is related to Intelligent Data Management Framework for Microsoft Dynamics. If you have installed IDMF then trying to start IDMF then facing error like must complete post installation task then you can resolve error by using following menu path. Click Start > All Programs > Intelligent Data Management Framework > Post-installation tasks If you are using windows 8 r2 then you can type post installation on startup like this screen. After running this you will see command prompt which will show instruction step by step like xpo import,synchronization of meta database .You may face rights error during that so you need to resolve in SQL management studio by give permission of database to user.

Find Ledger Account Id by Ledger dimension in Ax 2012

To Find Ledger Account Id by Ledger dimension in Ax 2012 you can get hint from below code. findByLedgerDimension is a method defined in Mainaccount table where you can pass ledgerdimension value . MainAccountId is field name which is created in MainAccount Table. MainAccount Table is main master table for Ledgers. info(strFmt("%1",MainAccount::findByLedgerDimension(3427167077).MainAccountId));

Get or split values start and end from range in Ax 2012

This is code sample to Get or split values from range in Ax 2012. For example you provided range from 100 to 110 and want both value start value and end value in some variable then you can use container to split range values. str range; str startValue,endValue; List ledgerRange= new list(Types::String); ListIterator listiterator; container con; range = "100..110"; rangevalue= strSplit(range,".."); listiterator = new listiterator(rangevalue); while(listiterator.more()) { con += listiterator.value(); listiterator.next(); } startValue = conpeek(con,1); endValue = conPeek(con,3); info(startValue); info(EndValue);    

Query to get Tax Registration Number by party Name in Ax 2012

This is the Query to get Tax Registration Number by party Name in Ax 2012. Intermediate table for DirPartyTable and taxRegistration is DirPartyLocation and registrationNumber is the field to get value of tax registration Number. DirPartyTable DirPartyTable; DirPartyLocation DirPartyLocation; taxRegistration taxRegistration; select * from DirPartyTable where DirPartyTable.Name == "TestName"; select * from DirPartyLocation where DirPartyLocation.Party == dirPartyTable.RecId; select registrationNumber from taxRegistration where taxRegistration.DirPartyLocation == dirPartyLocation.RecId; info(strFmt("reg %1",taxRegistration.RegistrationNumber));

Hints and steps to install Ax 2012 in Windows 8

Following are the Hints and steps to install Ax 2012 in Windows 8 1.Installation is easy but first of all you have to be aware regarding prerequisites and the platform, where you are going to run AX. a)  Microsoft .NET Framework Most Microsoft Dynamics AX components, including the Setup wizard, require .NET Framework 3.5 with Service Pack 1. For those components that require.NET Framework 4.0, it is listed as an additional requirement in this document. b)         Microsoft Windows® Installer 3.1 or Windows Installer 4.0 c)Additional requirements ·         .NET Framework 4.0 with the hotfix from Knowledge Base article number 2390372. ·         Microsoft SQL Server 2008 Native Client 2.First of all if you want to make your system stand alone, then you need to attach a domain with your client. for that thing you need to install windows server 2008R2/Windows server 2012 R2, then you can connect with this. or if you want to install directly in the Windows 8 then there is a tric