Thursday 27 February 2014

AX 2012 layer magic

Hi,
Many times it so happens that the developer is engrossed in his work and he happens to write his code in the wrong layer. This can cause big troubles when you are dealing with clients.
A very common scenario is:

You are working in the cus or isv layer. Suddenly during the development the client gets stuck and asks you to restart the client(very common in AX 2012). And then you click YES.

There is a bug in here. When the AX restarts, it will open the AX in the usr layer instead of the layer you were working in. So be careful here.

Wednesday 26 February 2014

Error: Cannot create a record. Record already exists.

Hi,
Sometimes you would encounter this error no matter what you do.
If there is no technical flaw, just try these two steps:

1. Restart SQL Server service
2. Restart AOS

Monday 17 February 2014

How do I deploy reports to for different AOS configurations using powershell?

Enter this command in the powershell:

Publish-AXReport –Id SSRSConfigID -ReportName SalesInvoice

SSRSConfigID refers to a configuration ID that was defined in Microsoft Dynamics AX. 

To view these configuration IDs, open Microsoft Dynamics AX and then open the Report servers form. (Click System administration > Setup > Business intelligence > Reporting Services > Report servers.) To deploy reports to the new Reporting Services instance, enter the configuration ID that is associated with that instance.

How do I set a default tab in a form?

Many times, you want a particular tab to be selected by default against a certain condition. This can be accomplished by simply calling the tabName.activePage() method. 

Saturday 15 February 2014

Update conflict while posting credit note against fully invoiced Sales order



Hi,
At times you would receive this strange error all of a sudden that would not let you post a credit note. In particular, when you do not want the sales order lines to be deleted and wish to retain the original order.
In order to fix this bug, just add a line a code in the "SalesCopying" class.


In the copy method, just add this line highlighted in green. In my environment, this is line no 530.