Friday, January 29, 2016

Finding out which tables were updated by an operation in AX

Today while searching for some issue I stopped at a very interesting and neat trick in AX. Using this trick you can get a list of tables which get updated while performing any operation. I am sharing the blog post as is here with the source:

At times when troubleshooting Microsoft Dynamics AX you need to know which tables were updated by a particular operation, for example after performing a posting. This could be if you want to be sure that all the right tables are updated correctly after an upgrade, if you have unexpected results on one customer/vendor etc or if you have made an update the system and you want to be sure that everything is ok.
It is possible to use the SQL trace for this, but for functional people it can be at times be a bit challenging to interpret these results, so here is a tip for how you can easily find out which tables were updated when performing an operation in AX. In this example, we will show the effect on tables from a Sales Invoice posting in Microsoft Dynamics AX 2012 as this is quite a complex process that affects many tables.
The whole technique here relies on using a standard report ‘Size of company accounts’ in a novel way. This report returns an output of all the tables in AX that have data in them. In this article, we will see how we can use this report to print a snapshot of the tables before and after an operation so that when we print it ‘after’ we will see which tables got data populated into them from an AX operation.


The steps are as follows
1.  Go to the AOT and locate the Class ‘SysCompanySizeDP’ and open up the method called ‘insertIntoTempTable’. Change the highlighted function from ‘tableid2Pname’ to instead ‘tableid2name’. The reason we are changing the function is that it is easier to locate the tables in the AOT when the report prints the tables using the technical names. If we didn’t do this, the report would, for example, print the name of a table like ‘Customer Invoice Journal’ instead of ‘CustInvoiceJour’
2. Now go to System Administration\Reports\Database\Size of company accounts and run the report. Note the technical names

3. Export this report to Excel

4. Open up the saved Excel sheet and notice that the report content is copied over
5. Now let’s make a sales order invoice posting
6. We go back to System Administration and run the company size report again and once more save it, this time under a different name, for example ‘Company Size 2’

7. Now we copy the tables in the sheet from the last run ‘Company size report’ to the first saved Company size Excel sheet

So that we have a sheet with 2 different ‘Company size’ report executions – Before and after the Sales Order invoice posting

8. Now add a new column ‘Difference’ with a simple calculation extracting cell ‘C’ from cell ‘H’ and copy it across the rows as highlighted on
the screenshot in red below. Notice also the black box, that shows already some tables that have been affected

9. Now in order to easily identify which tables were affected by the posting, we can do this trick, apply a filter in the ‘Difference’ column
and unmark ‘blanks’ in the display of the cells’ values
RESULT
We can now see easily which tables were updated by the Sales Order posting. The same technique can naturally be used by any other kind of operation in AX, such as a Journal posting or a Master Planning run – all it relies on is just tracing which tables were updated since the last run of the report. Have fun!


Source: https://blogs.msdn.microsoft.com/axsupport/2013/09/27/finding-out-which-tables-were-updated-by-an-operation-in-ax/

Sunday, January 24, 2016

Unable to connect to the AOS specified in the AX Client Configuration in SSRS

Today, I faced a really weird issue while designing a report in VS2012. After designing the report I tried building the solution and got the below error:

Error 1 Unable to connect to the AOS specified in the AX Client Configuration. The configuration could be missing, invalid, or the AOS is not running. To connect to the AOS, check the network connection between the client and the AOS, verify that a valid configuration exists and that the AOS service is running on the server. C:\Program Files (x86)\MSBuild\Microsoft\DynamicsTools\Microsoft.Dynamics.Framework.Design.Reporting.Modeling.targets 103 6 ReportModel2



Error 2 The "GenerateRdlTask" task failed unexpectedly.

Microsoft.Dynamics.Framework.BusinessConnector.Session.Exceptions.NoKernelSessionException: Unable to connect to the AOS specified in the AX Client Configuration. The configuration could be missing, invalid, or the AOS is not running. To connect to the AOS, check the network connection between the client and the AOS, verify that a valid configuration exists and that the AOS service is running on the server. --->


After trying the obvious things like verifying the SSRS & BC configurations and connectivity, I had to move to the boss "Google" and got out a really interesting thing about how Business Connector works:


"The root cause is the SSRS report file size is exceeding the limit, as there are multiple layouts for the report file, and each layout has several pictures embedded. So, the size was over 10M, we tried multiple times, the report can work correctly when the size is relatively small, but once over about 10M, the business connector cannot hold the report effectively and the connect is lost.


The solution is to create another SSRS file to have other layouts."


I had created a copy of the existing design which was exceeding the size so I deleted it and all worked fine.




Source: http://dynamicsuser.net/forums/t/84427.aspx

Friday, January 22, 2016

SSRS performance improvement

With one of our clients, we were facing this issue of reports loading really slow. Even the simple document reports were taking 2-3minutes to display data. So finally the solution came out that we need to increase the recycle time of the SSRS.

That's how to do this:
Navigate to "C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer" (depending on the SSRS version).

Look for file RSReportServer.config and open it.

Now find the tag "RecycleTime" from the default "720" to "1440". You can try increasing the value further depending on the performance.


Hope this helps. :)