Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows Server

Microsoft Dynamics AX 2009 : The MorphX Tools - Code Compiler & Dynamics AX SDK

- 2015 Chevrolet Camaro Z28 - The Legend Returns
- Wagon Audi Allroad Vs. Subaru Outback
- 996 Carrera 4S is Driving Perfection
7/25/2011 11:32:42 AM

Code Compiler

Whenever you make a change to X++ code, you must recompile, just as you would in any other development language. You start the recompile by pressing F7 in the X++ code editor. Your code also recompiles whenever you close the editor or save a dirty element.

The compiler also produces a list of the following information:

  • Compiler errors These prevent code from compiling and should be fixed as soon as possible.

  • Compiler warnings These typically indicate that something is wrong in the implementation. See Table 1, later in this section, for a list of compiler warnings. Compiler warnings can and should be addressed. Check-in attempts with compiler warnings are rejected.

    Table 1. Compiler Warnings
    Warning MessageLevel
    Break statement found outside legal context1
    The new method of a derived class does not call super()1
    The new method of a derived class may not call super()1
    Function never returns a value1
    Not all paths return a value1
    Assignment/comparison loses precision1
    Unreachable code2
    Empty compound statement3
    Class names should start with an uppercase letter4
    Member names should start with a lowercase letter4

  • Tasks (also known as to-dos) The compiler picks up single-line comments that start with TODO. These comments can be useful during development for adding reminders, but you should use them only in cases in which implementation can’t be completed.

    For example, you might use a to-do comment when you’re waiting for a check-in from another developer. You should avoid using to-do comments just to postpone work. For a developer, there is nothing worse than debugging an issue at a customer site and finding a to-do comment indicating that the issue was already known but overlooked.

    Note

    Unlike other languages, X++ requires that you compile only code you’ve modified. This is because the intermediate language the compiler produces is persisted along with the X++ code and metadata. Of course, your changes can require other methods consuming your code to be changed and recompiled if, for example, you rename a method or modify its parameters. If the consumers are not recompiled, a run-time error is thrown when they are invoked. This means that you can execute your business application even when compile errors exist, as long as you don’t use the code that can’t compile. You should always compile the entire AOT when you consider your changes complete, and you should fix any compilation errors found.


The Compiler Output dialog box provides access to everything reported during compilation, as shown in Figure 1. Each category of findings has a dedicated tab: Status, Errors And Warnings, Best Practices, and Tasks. Each tab contains the same information for each issue that the compiler detects—a description of the issue and its location. For example, the Status tab shows a count of the detected issues.

Figure 1. Compiler Output dialog box

You can export compile results. This capability is useful if you want to share the list of issues with team members. The exported file is an HTML file that can be viewed in Microsoft Internet Explorer or re-imported into the Compiler Output dialog box in another Dynamics AX session.

In the Compiler Output dialog box, click Setup and then click Compiler to define the types of issues that the compiler should report. Compiler warnings are grouped into four levels, as shown in Table 1.

Dynamics AX SDK

Constructing quality software has become a daunting task in the 21st century. Many new competencies are expected of the developer, and mastering them fully and at all times is nearly impossible. Today you must write code conforming to many technical requirements, including security, localization, internationalization, customization, performance, accessibility, reliability, scalability, compatibility, supportability, interoperability, and so on. The list seems to grow with each software revision, and keeping up with all of these competencies is increasingly difficult.

Microsoft Dynamics AX 2009 includes a software development kit (SDK) that explains how to satisfy these requirements when you use MorphX. You can access the SDK from the application Help menu under Developer Help. We highly recommend that you read the Developer Help section—it’s not just for novices but also for experienced developers, who will find that the content has been extensively revised for Dynamics AX 2009. The SDK is frequently refreshed with new content, so you might want to check it often on MSDN.

Among other critical information, the Developer Help section of the SDK includes an important discussion on conforming to best practices in Dynamics AX. The motivation for conforming to best practices should be obvious to anyone. Constructing code that follows proven standards and patterns can’t guarantee a project’s success, but it certainly minimizes the risk of failure. To ensure your project’s success, you should learn, conform to, and advocate best practices within your group.

The following are a few benefits of following best practices:

  • You avoid less-than-obvious pitfalls. Following best practices helps you avoid many obstacles, even those that surface only in border scenarios that would otherwise be difficult and time consuming to detect and test. Using best practices allows you to leverage the combined experiences of Dynamics AX expert developers.

  • The learning curve is flattened. When you perform similar tasks in a standard way, you are more comfortable in an unknown area of the application. Consequently, adding new resources to a project is more cost efficient, and downstream consumers of the code are able to make changes more readily.

  • You are making a long-term investment. Code that conforms to standards is less likely to require rework during an upgrade process, whether you’re upgrading to Dynamics AX 2009, installing service packs, or upgrading to future releases.

  • You are more likely to ship on time. Most of the problems you face when implementing a solution in Dynamics AX have been solved at least once before. Choosing a proven solution results in faster implementation and less regression. You can find solutions to known problems in both the Developer Help section of the SDK and the code base.

Top Search -----------------
- Windows Server 2008 R2 : Work with RAID Volumes - Understand RAID Levels & Implement RAID
- Windows Server 2008 R2 Administration : Managing Printers with the Print Management Console
- Configuring Email Settings in Windows Small Business Server 2011
- Windows Server 2008 R2 : Configuring Folder Security, Access, and Replication - Implement Permissions
- Monitoring Exchange Server 2010 : Monitoring Mail Flow
- Windows Server 2008 R2 :Task Scheduler
- Windows Server 2008 R2 : File Server Resource Manager
- Windows Server 2008 R2 : Installing DFS
- Exchange Server 2010 : Managing Anti-Spam and Antivirus Countermeasures
- Windows Server 2008 R2 : Configuring Folder Security, Access, and Replication - Share Folders
Other -----------------
- Microsoft Dynamics AX 2009 : The MorphX Tools - Visual Form Designer and Visual Report Design
- Windows Server 2008 R2 : Work with Windows Updates (part 3) - Use Group Policy to Configure Automatic Updates
- Windows Server 2008 R2 : Work with Windows Updates (part 2)
- Windows Server 2008 R2 : Work with Windows Updates (part 1)
- SQL Server 2005 : Privilege Escalation Without Ownership Chains
- SQL Server 2005 : Privilege and Authorization - Ownership Chaining
- SQL Server 2005 : Privilege and Authorization - Basic Impersonation Using EXECUTE AS
- Configuring Standard Permissions for Exchange Server 2010 (part 2) - Understanding & Assigning Advanced Exchange Server Permissions
- Configuring Standard Permissions for Exchange Server 2010 (part 1)
- Feature Overview of Microsoft Lync Server 2010 : Dial-In Conferencing & Enterprise Voice
 
 
Most view of day
- Microsoft Dynamic CRM 4 : Data Migration (part 4) - Creating a Data Migration
- Leveraging Social Networking Tools in SharePoint 2010 : Restricting User Access to and Creation of My Site Sites
- Microsoft Dynamics AX 2009 : The MorphX Tools - Code Compiler & Dynamics AX SDK
- Windows Server 2003 : Securing Network Communications Using IPSec - Troubleshooting Data Transmission Security
- Building BizTalk Server 2009 Applications : Setting up new BizTalk projects
- Iphone Application : Using Gesture Recognizers (part 4)
- Microsoft Dynamics AX 2009 : Working with Data in Forms - Processing multiple records
- Windows Server 2008 R2 : Elements of Group Policy (part 5)
- Maintaining and Troubleshooting Windows 7 : Using Windows RE (part 1) - Accessing the WinRE
- Windows Server 2008 R2 : Deploying and Using Windows Virtualization - Quick Migration and Live Migration (part 2)
Top 10
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 8) - Configuring Transport Rules
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 7) - Configuring Journal Rules
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 6) - Verifying Edge Subscriptions, Removing Edge Subscriptions
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 5) - Getting Edge Subscription Details, Synchronizing Edge Subscriptions
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 4) - Creating an Edge Subscription
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 3) - Enabling Anti-Spam Features
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 2) - Configuring the Transport Dumpster , Configuring Shadow Redundancy
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 1) - Configuring Transport Limits
- Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 7)
- Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 6)
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro