Agile Tortoise
Greg Pierce’s blog
« iPhone, hands on Noble creatures »
How _not_ to create sales orders in AX from VB
Microsoft has published a wonderful how-to on using the Dynamics AX Business Connector to create sales orders from VB. Only, I feel sorry for you trying to maintain this code if you do it the way they recommend!
It’ll work, yes…but, it’s extremely verbose. Individually setting field values across the .NET/COM connector is a performance hit, but also really difficult to maintain. It also gives you no encapsulation and control of the interface to the external application from inside AX. Please, please, if you are considering doing an external application interface to AX like this, take the time to implement a Gateway.
Typically, I will write a class in X++ with static methods that serves as the Gateway to the external application. Then, my calls into AX will go exclusively through that Gateway. Then I have a way to intervene if there’s some special validation I want to perform on the incoming request — or, say I decide I want the new sales orders from this external application to go into a holding zone before going live — I can implement that in my X++ class without having to recompile and rerelease the external binary.
On the bright side, MS’s screenshots at least demonstrate what a beautiful UI you can make with Windows.Forms. ![]()