This blog contains posts from the Microsoft Dynamics AX support team highlighting interesting features or issues within Microsoft Dynamics AX.
[Note: This article pertains to the Blank Operation in AX for Retail 2009. While writing this, I discovered that there are additional issues with the similar functionality in the 2012 version of the plug-in. I will update the article when those issues have been tracked down.]
As I mentioned in my previous article about the Blank Operation, there are a couple issues with the support classes provided with the blank operation. Specifically, there are two bugs in ItemSale.cs.
The ItemSale.cs file contains the ItemSale() class. This class provides a quick way to add items to the transaction via code. To call the class you would use code similar to the following:
The first issue happens if you are adding an item to a brand new transaction using this method. When creating a new transaction, a “blank” customer needs to be added otherwise the tax engine will not calculate taxes properly. Add the bolded lines of code to correct the issue:
The second problem is due to the way that the BarCode object gets initialized which could cause an unhandled exception downstream. The simple fix here is to comment out the two lines of code that initialize the object and always send a null value instead:
If you plan on programmatically adding items to the transaction using this method, these two fixes should help you out.
Other Microsoft Sites
I'm a Customer
I'm a Partner
Follow Microsoft Dynamics