Share via


Dynamics AX Development and Customization Best Practices-Coding

When using the Microsoft Dynamics AX development environment, you should follow a set of best practices. The X++ compiler checks the code for best practice issues. These issues can result in best practice errors, warnings, or informational messages.

In this article we covers Microsoft Dynamics AX application development best practices. They are recommended for any Microsoft Dynamics AX partner or end user who is developing or customizing Microsoft Dynamics AX.

These best practices apply to the following:

  • Programming in the standard application
  • Certified solutions

Following are the steps to check code and application objects for compliance with the best practices for Microsoft Dynamics AX.

  • Open AOT by using short Key (CTRL+D)

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/1.png

  • Select Tools > Options from above screen the following window will be shown

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/5488.2.jpg

  • Click the Development from left panel of above screen.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/5504.3.jpg

    • Click the Best practices button. On above screen and the following popup window will show.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/8407.4.jpg

  • As in the above screen the following Warning level list you can select that you want to perform also layer can be selected on which you want to perform best practice.
    • Errors only
    • Errors and warning
    • All

Note: the best practices are checked when you compile or check in an object.

We can also check best practices for one or more nodes in the Application Object Tree (AOT): right-click the node, and then select Add-Ins > Check Best practices.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/8053.5.jpg

Output will be shown with the following severity code:

  • Information: Things that might be nice to know (shown in blue).
  • Warnings: Things that you should strongly consider fixing (shown in yellow).
  • Errors: Things that should definitely be fixed (shown in red).

In next article we will cover the Pest Practices of code Customization standards.