Dedugging in dynamics Axapta

The code editor in Dynamics AX has some intellisense, typing the name of a table or class variable followed by . or :: will give you a list of fields or methods available for that item. After you type the ( to start a method call, a tooltip pops up with parameters available on that method. When starting a new line, you can right click and List Tables, List Classes, List Types, etc. Most of those commands are also available via Shortcut Keys. Note that the intellisense only works if all the code in the method up to the location of your cursor is syntactically correct.

Make sure you have updated the cross reference in your development environment (Tools/Development tools/Cross-reference/Periodic/Update). With an updated cross reference, you can right click an any table, field, class, method, extended data type, or enum in the AOT and choose Add-Ins/Cross-reference/Used by to see where that item is used in the system.

You can also use Tools/Development tools/Code explorer to view the source to the application with all types, variables, and methods turned into hyperlinks so you can click to go right to the definition of that item.

Another useful tool is Application hierarchy tree, available either under Tools/Development tools, or on the right click Add-Ins menu. This will show you the class hierarchy, so you can easily see, for example, that SalesFormLetter derives from FormLetter, which derives from RunBaseBatch.

In the editor, you can highlight text and right click to Lookup Properties/Methods or Lookup Definition.

If you are trying to track down where in the system a particular infolog message is generated there are two strategies to use:

1.Set a breakpoint on the first line of the method Info.add(). Then when you run the code generating the message, you will pop into the debugger as soon as the infolog is generated. You can then look at the stack trace in the debugger to see where the code is that generated the message.

2.Run Tools/Development tools/Label/Label editor and search for the text of the message. Select the Label ID of the message, then click Used by to see where that message is used in the system.

Comments