Wednesday, June 27, 2018

Compiler

When code that is written in X++ is ready to be executed, use the compiler. The
compiler is a translation program that converts X++ into a language that can be
interpreted.
Code can be compiled by clicking the
Compile button in the X++ editor toolbar
or by pressing
F7. It can also be compiled by right-clicking the node in the AOT
and selecting Compile.
In this course you will also learn about inheritance. Classes that inherit from, or
extend, other classes can be compiled by right-clicking the main class, then
selecting Add-Ins > Compile forward. This means any changes that are made to
the main class are propagated down to the sub
-classes correctly.
Use the
Compiler Output window to view information to help improve and
correct errors in the code. The
Output window will update its contents every
time a compilation is performed.


There are four different compile result types:
Result type Description
Error These are compile errors, and must be resolved before
code can be run.
Warning These are compile warnings, and should be resolved,
but will not prevent the code from being run.
Best Practice These are found when an element contains code or
properties that deviate from the list of Microsoft
Dynamics AX Developers Best Practices. Best Practice
deviations are only found by the compiler when the
Diagnostic level is set to Level 4. The Diagnostic level
is a parameter accessible from the
Setup button,
explained later in this material.
Task Tasks are placeholders that can be added to X++ code
to remind developers that something is unfinished. To
create a task, use a single line comment, followed by
the word ToDo and a description of the task. For
example:
// ToDo Add validation code

The Compiler window contains the following features: Filter buttons: At the top of the window, there are buttons to toggle
the four different compile result types on and off. Toggling the result
type off will remove results of that type from the
Compiler Outputwindow's list. Reset button: This button will reset the contents of the Compiler
Output
window. Edit button: This button will open the X++ editor or Property sheet
corresponding to the selected compile result.
Import/Export button: This button allows compile results to be
exported to an HTML file, or imported into the
Compiler Outputwindow from an HTML file. Setup button: This button accesses forms where the Compiler
Output
window parameters can be set for the user. These include
settings such as the Diagnostic level of the compiler, and which Best
Practices will be enforced


DebuggerMicrosoft Dynamics AX includes a powerful stand-alone debugging tool for
X++ code. Use the Debugger to debug X++ code running on the:
Microsoft Dynamics AX ClientMicrosoft Dynamics AX Object Server (AOS)NOTE: Managed code and X++ compiled into Intermediate Language (IL) are
debugged using the Visual Studio debugger. This topic will be covered in the
Visual Studio Integration chapter of the Development III course. This topic only
covers debugging standard X++ code.
Use the Debugger to:Run a program to a certain point and then stop at a defined
breakpoint.
Step through the program one statement at a time.Display the call stack with code line numbers.Watch specific variables and modify their values during execution.Track messages being sent to the infolog.
Best Regards,
Hossein Karimi

1 comment:

  1. Thank you for sharing the articles Aot vs Jit Compiler
    . this really helps me in my developer’s journey.

    ReplyDelete

Configure the Firewall on the Enterprise Portal Server

After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...