Macros Best Practices [AX 2012]
Updated: December 2, 2011
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Macro names should start with an uppercase letter.
For constant values that are used in multiple places in your code, you should use #define to define a macro that has the constant value. If you must change the value later, you have to change only the one macro definition. You would not have to find and edit every location where the value is used.
If the constant applies beyond the range of one class and the classes that extend from it, the macro definition must be in a macro library. Macro libraries are stored in the Application Object Tree (AOT) under the Macros node.