Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Microsoft Dynamics AX 2009 : The MorphX Tools - Debugger

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
8/4/2011 3:59:00 PM
Like most development environments, MorphX features a debugger. The debugger is a stand-alone application, not part of the Dynamics AX shell like the rest of the tools . As a stand-alone application, the debugger allows you to debug X++ in any of the Dynamics AX components in the following list:
  • Microsoft Dynamics AX client

  • Application Object Server (AOS)

  • Enterprise Portal

  • Business Connector

Using the Debugger

For the debugger to start, a breakpoint must be hit during execution of X++ code. You set breakpoints by using the X++ code editor in the Microsoft Dynamics AX client. The debugger starts automatically when any component hits a breakpoint.

You must enable debugging for each component as follows:

  • In the Microsoft Dynamics AX client, click the Microsoft Dynamics AX drop-down menu, point to Tools and then Options. On the Development tab, select When Breakpoint in the Debug Mode list.

  • For the AOS, open the Microsoft Dynamics AX Server Configuration utility under Start\Administrative Tools. Create a new configuration (if necessary), and select the check box labeled Enable Breakpoints To Debug X++ Code Running On This Server.

  • For Batch jobs, open the Microsoft Dynamics AX Server Configuration utility under Start\Administrative Tools. Create a new configuration (if necessary), and select the check box labeled Enable Global Breakpoints To Debug X++ Code Running In Batch Jobs.

  • For Enterprise Portal and Business Connector, open the Microsoft Dynamics AX Configuration utility under Start\Administrative Tools. Select one of two check boxes on the Developer tab: Enable User Breakpoints For Debugging Code Running In The Business Connector or Enable Global Breakpoints For Debugging Code Running In The Business Connector Or Client. The latter is useful for debugging incoming Web requests.

Caution

We recommend that you do not enable any of the debugging capabilities in a live environment. If you do, execution will stop when it hits a breakpoint, and users will experience a hanging client.


The debugger allows you to set and remove breakpoints by pressing F9. You can set a breakpoint on any line you want. If you set a breakpoint on a line without an X++ statement, however, the breakpoint will be triggered on the next X++ statement in the method. A breakpoint on the last brace will never be hit.

You can enable or disable a breakpoint by pressing Ctrl+F9. For a list of all breakpoints, press Shift+F9.

Breakpoints are persistent in the SysBreakpoints database table. Each developer has his or her own set of breakpoints. This means that your breakpoints are not cleared when you close Dynamics AX and that other Dynamics AX components can access them and break where you want them to.

Debugger Interface

The main window in the debugger initially shows the point in the code where a breakpoint was hit. You can control execution one step at a time while variables and other aspects are inspected. Figure 1 shows the debugger opened to a breakpoint with all the windows enabled.

Figure 1. Debugger with all windows enabled

In the following subsections, we briefly describe the debugger’s various windows and some of its other features.

Main Window

The main debugger window shows the current X++ code. Each variable has a ScreenTip that reveals its value. You can drag the next-statement pointer in the left margin. This pointer is particularly useful if the execution path isn’t what you expected or if you want to repeat a step.

Variables Window

In this window, local, global, and member variables are shown. Local variables are variables in scope at the current execution point. Global variables are the global classes that are always instantiated: Appl, Infolog, ClassFactory, and VersionControl. Member variables make sense only on classes, and they show the class member variables.

The Variables window shows the name, value, and type of each variable. If a variable is changed during execution stepping, it is marked in red. Each variable is shown associated with a client or server icon. You can modify the value of a variable by double-clicking the value.

Tip

As a developer, you might want to provide more information in the value field than what is provided by default. For a class, the defaults are New and Null. You can change the defaults by overriding the toString method. If your class doesn’t explicitly extend object (the base class of all classes), you must add a new method named toString, returning str and taking no parameters, to implement this functionality.


Call Stack Window

The Call Stack window shows the code path followed to arrive at a particular execution point. Clicking a line in the Call Stack window opens the code in the Code window and updates the local Variables window. A client or server icon indicates the tier on which the code is executed.

Watch Window

In the Watch window, you can inspect variables without the scope limitations of the Variables window. You can drag a variable here from the Code window or the Variables window.

The Watch window shows the name, value, and type of the variables. Five different Watch windows are available. You can use these to group the variables you’re watching in the way that you prefer.

Breakpoints Window

The Breakpoints window lists all your breakpoints. You can delete, enable, and disable the breakpoints via this window.

Output Window

The Output window shows the traces that are enabled and the output sent to the Infolog application framework. The Output window includes the following pages:

  • Debug You can instrument your X++ code to trace to this page by using the printDebug static method on the Debug class.

  • Infolog This page contains messages in the queue for the Infolog.

  • Database, Client/Server, and ActiveX Trace Any traces enabled on the Development tab in the Options dialog box appear on these pages.

Status Bar

The status bar at the bottom of the debugger offers the following important context information:

  • Current user The ID of the user who is logged on to the system. This information is especially useful when you are debugging incoming Web requests.

  • Current session The ID of the session on the AOS.

  • Current company accounts The ID of the current company accounts.

  • Transaction level The current transaction level. When reaching zero, the transaction is committed.

Debugger Shortcut Keys

Table 1 lists the most important shortcut keys available in the debugger.

Table 1. Debugger Shortcut Keys
ActionShortcutDescription
RunF5Continue execution
Stop debuggingShift+F5Break execution
Step overF10Step over next statement
Run to cursorCtrl+F10Continue execution but break at the cursor’s position
Step intoF11Step into next statement
Step outShift+F11Step out of method
Toggle breakpointShift+F9Insert or remove breakpoint
Variables windowCtrl+Alt+VOpen or close Variables window
Call Stack windowCtrl+Alt+COpen or close Call Stack window
Watch windowCtrl+Alt+WOpen or close Watch window
Breakpoints windowCtrl+Alt+BOpen or close Breakpoints window
Output windowCtrl+Alt+OOpen or close Output window
Other -----------------
- Microsoft Dynamics AX 2009 : The MorphX Tools - Best Practices Tool
- Windows Server 2008 Server Core : Working with Terminal Server (part 2)
- Windows Server 2008 Server Core : Working with Terminal Server (part 1)
- Active Directory Domain Services 2008 : Manage Active Directory Domain Services Data - Delete a Group Object
- Active Directory Domain Services 2008 : Create a Group Object
- Windows Server 2008 R2 : Understand Group Policy (part 2) - Learn Group Policy Processing
- Windows Server 2008 R2 : Understand Group Policy (part 1) - Understand the Scope of Group Policy Management & Understand and Control the Order of Precedence
- Windows Server 2008 R2 : Work with Windows Server Update Services
- SQL Server 2005 : Testing Database Routines - Guidelines for Implementing Database Testing Processes and Procedures
- SQL Server 2005 : Testing Database Routines - Introduction to Black Box and White Box Testing
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer