Skip to main content

Posts

Showing posts from October, 2015

Open journal line form is slow [AX 2012]

I have posted a few times about journal performance. Make sure to have a look at those. This one is specifically about open the journal line form being slow. I tested with a 40,000 line journal.  Opening the form took about 7 minutes. I ran the code profiler against it and found one particular method that took way too long. taxAmountJournal(). It ended up being a display method. This particular display method shows up on the form as “Calculated sales tax amount”. After right click and hiding the field, the load of the form is instant. Same when jumping (focus) from line to line.

KB3034554 - Ledger journal performance [AX 2012]

A bit of a spotlight on this KB. I wasn’t aware of for some time and now it is included in AX2012R3CU9. Problem was that each line insert/update/delete caused a tax calculation. This was more prominent when importing large journals (several thousand lines). The solution Microsoft provides in this KB is a technical solution. It gives you the ability to ignore tax calculations if you wanted to do it while importing (via AIF or custom code). I have written something previously that discusses this. http://dynamicsnavax.blogspot.com.au/2014/04/tips-to-improve-ledger-journal-import.html   https://fix.lcs.dynamics.com/Issue/Resolved/616114?kb=3034554&bugId=3360809&qc=0872aea67f72bae9e4f30e1e2f653e6071a7556b6589633dd4fdf521cd720f5b Note: This new field is not part of the DIXF journal entity. Here is a work around. Because the Fields in the query are set to Dynamic=No. Lets add it ourselves Right click and add the field. Refresh the target entity by either deleting a

Multithreading with Business Operation Framework [AX 2012]

In this post I will discuss the basics of multi threading with business operations framework and I will provide a sample you can work with. Multithreading can give you a huge performance boost if you could spin each process separately. The biggest hurdle with writing a process to work via multi threading can be a little confusing and time consuming to develop. So, what I have done is create a generic xpo project which I have used many times as a starting point. Below is a screenshot of what the net result is of my sample project. The xpo contains the following project. Download xpo The \Classes\Processor\process method is the main entry method. If it is run with out the batch it will execute each record separately. Otherwise, if it is run in batch it will bundle the records based on a default bundle size (I have set it to 10). I then use a list to store the 10 customer recIds. The reason I bundle the records is because when you multithread, you may not want to process each r