Pages

Saturday 3 January 2015

How to do code debugging in ax 2012 or 2009

To enable debugging for the server

Log into the server that is running the AOS.

Open the Microsoft Dynamics AX Server Configuration utility with administrative privileges (Start > Administrative Tools > Microsoft Dynamics AX 2012 Server Configuration). To run the utility with administrative privileges, you must right-click its icon in the Start menu and click Run as administrator.

Create a new configuration that allows for debugging.

Click Manage and then click Create configuration. In the Create Configuration window, name the new configuration, such as "DAX Debugging". Click OK.

On the Application Object Server tab, select Enable breakpoints to debug code X++ code running on this server. Click Apply. If you receive a message about the AOS, indicate that it should be restarted.
Click OK to close the configuration window.


To debug the submit code for workflow

Open the Development Workspace.
In the AOT, locate the submit code that you want to debug. Typically, this will be the main method of your submit to workflow class.

Set breakpoints in the X++ code by using the Code Editor.

In Microsoft Dynamics AX, perform the submit operation for workflow. The Debugger should open and stop at the breakpoint you set.


Microsoft Dynamics AX debugger:
Steps
Description
Code Window  :  To shows the code which is currently being debugged.
Variables Window : Explains how to use the Variables window.
Watch Window    :   Explains how to use the Watch window.
Output Window    : Explains how to use the Output window.
Call Stack Window : Explains how to use the Call Stack window.
Breakpoints Window : Explains how to use the Breakpoints window.


These windows display detailed information about the current state of the executing code while you are debugging. You can move, undock, resize, or hide these windows. The chosen window layout persists between sessions. It is also possible to print or copy text from any window.