Best Practices – Technical Best Practices for Dynamics AX

June 28, 2010 No comment

While surfing on the web about Ax Best-Practices I found the following link on Packt Publishing. I think this is a verry good list of things a Ax developer should do while programming.

This article is a part of the book ‘Quality Assurance for Dynamics AX-Based ERP Solutions‘, maybe I’ll read it.

(more…)

The Ax Infolog

May 7, 2010 No comment

Wel all know the small dialog that gives the user usefull information about what is happening in Ax. In this post I will tell u some more about this.

You can add information to the Infolog by calling:


(more…)

Tip for overriding methods

April 19, 2010 3 comments

There is a simple and generic way to force overriding a method you created. To do so you just need create your new method and place a ‘throw error’ statement in it. To finish you can add the static method missingOverride from the error class and the funcName() to your error. Now when this method is called or the super() in you child class is called, you will get a error that you need to override your method.

public identifiername myMethod()
{
    throw  error(Error::missingOverride(funcName()));
}

When you use this peace of code you will get the following error:

Note: The error-class also has some other usefull static methods like: missingFormActiveBuffer, missingOverload, missingOverride, missingParameter, missingRecord and my favorite wrongUseOfFunction

Working with numbersequences – Keep In Mind

February 17, 2010 No comment

When you are using a Number Sequence, keep in mind that a Continuous Number Sequence is slower than a non-continuous. The reason is that the system creates a record in the table NumberSequenceList (with the status Active) and cleans it up later during TTSCOMMIT.

Performance tip: You can improve the performance of a process that creates many numbers of one Number Sequence by using number pre-allocation. This loads a set of numbers into the memory and provides faster access. You can do this by using the NumberSeqGlobal, witch means that once it is instantiated, it is available until the session is closed. This function is only available for non-continuous Number Sequences. The numbers can only be retrieved from the cache by calling the getNumInternal() method in the NumberSeq_Fast class.

Placement of code

February 16, 2010 No comment

When you are programming, you have to think about where placing you’re code. Always try to place you’re code nearest to the source so it can be manipulated easily. For instance code that manipulates tables should be placed in that tables methods.

Best Practice: Try to minimize the x++ code in forms for the following reasons: