Friday, March 30, 2012

SalesTableForm Class

Customizing a Sales Order is one of the most frequent tasks in any Dynamics AX Implementation.
Form SalesTable is anyways a heavily customized form and writing any direct code on it (or for that matter on any form) is not advised.

So what could you do? Well that depends on what you want to do? :)

Writing code on a table or a class is what is best practice. In case of Sales Order form, code could be written on either SalesTable/SalesLine tables or SalesTableType/SalesLineType classes. But then there is only so much you can achieve writing code in the above two places.

In a recent interaction with Mr Lars Jacobsen from Norway, I discovered another way.
There is another class called SalesTableForm Class, which is recommended for writing code that affects your Sales Order form, header as well as lines.
For eg, if you need to dynamically create a new sales line when you satisfy some condition, you can write your code in the method SalesLine_write(). Do explore the class to figure it out more.

Wednesday, March 21, 2012

XPO Import Error

Recently I spotted a small error with Facility management Sample for AX 2012 so sharing that with my readers.
When you import the Facility_Management.xpo, you get an error like below.


As it is self-evident, some query is having a wrong version number. On a closer look, all the queries in the xpo have a version number of 31, whereas standard AX designates 29.
I changed the number from 31 to 29 and reimported. As expected, the import was successful.