1.Getting Started with Microsoft Dynamics AX

yompmulligrubsInternet και Εφαρμογές Web

31 Οκτ 2013 (πριν από 3 χρόνια και 10 μήνες)

1.856 εμφανίσεις

Microsoft Dynamics Axapta 2009

Page
1


1.Getting Started with Microsoft Dynamics AX

This section contains information that will get you started in Microsoft Dynamics AX.



Updated and additional developer documentation for Microsoft Dynamics AX can be found at the
Microsoft Dynamics AX Developer Center

on the Microsoft Developer Network (MSDN).



For new a
nd updated documentation for administrators, see the Microsoft TechNet site
Microsoft
Dynamics AX Online
.



For new and updated documentation for developers, see
AX 2009 SDK Updates on MSDN
.

This section contains the following topics:

Section

Description

What's New i n Mi crosoft
Dynami cs

AX for
Devel opers


Contains information about the new features and documentation that are
available in Microsoft Dynamics AX.

Getti ng Started Scenari os
i n Mi crosoft Dynami cs
AX


Contains walkthroughs of typical developer scenarios that you can use as an
introduction to the development environment or as the first steps towards your
own solutions in Microsoft Dynamics AX.

Development References


Contains a list of development references that you can use for learning more
about object
-
oriented development.

Videos for Deve
lopers in
Microsoft Dynamics AX


Contains information about videos for Microsoft Dynamics AX developers. Links
are also provided.


1.1
What's New in Microsoft Dynamics AX 4.0 for Developers

The following changes have been made to Microsoft Dynamics AX.

Version Control


Microsoft Dynamics AX now has a

version control system
. Version control functionality is integrated into the
Application Object Tree (AOT). You need to check out objects before you can edit them, and you need

to
add new objects to the version control system.

Microsoft Dynamics AX is integrated with Microsoft Visual Source Safe 2005, but you can extend the version
control functionality to use other version control tools.

Microsoft Dynamics Axapta 2009

Page
2


Note

The
Lock

command that was available in previous versions of Microsoft Dynamics AX is no longer available.
The
Lock

command was available from the shortcut menu in the AOT, and it allowed application objects to
be locked to prevent other users from modifying them.

ID Server

The version control system includes a new ID server, called the Team Server, that hosts the allocation of
new object IDs. The Team Server can be shared from multiple Application Object Server (AOS) installations
to provide unique assignment of IDs across m
ultiple project development environments.

Object History Functionality

A
version control system

provides object history. You can explore and compare different versions of an ob
ject
within a layer.

Code Access Security


Certain APIs that ship with Microsoft Dynamics AX use
Code Access Security
. This he
lps make the APIs more
secure.

For a list of the APIs that use Code Access Security (CAS), see
Secured APIs
.

You can also CAS
-
enable your own APIs. For more information, see
How to: Secure an API on the AOS
.

CLR Interoperability


The MorphX native language, X++, has been extended. It now provides sup
port for interoperability with
managed
-
code components. Within the AOT, managed
-
code assemblies can be referenced so they can be
used from X++. The support in X++ includes holding references to common language runtime (CLR) types
directly and implicit mars
haling between default kernel types and CLR types.

IntelliSense includes CLR types that are used as parameters with X++ methods. Supporting functions are
wrapped in the system utility class
CLRInterop
. Callouts to both static and instance methods on CLR t
ypes
are included in the support with the compile
-
time checking of arguments. Any exception that can occur in
the managed code is wrapped as a kernel exception with support for retrieving the corresponding CLR
exception objects in X++.

Business Connector


The Microsoft Dynamics AX Business Connector contains a new COM interface,
IAxapta3
.
IAxapta3

inherits
from previous Microsoft Axapta

3.0 (now a part of Microsoft Dynamics) COM interfaces,
IAxapta

and
IAxapta2
.

Note

Microsoft Dynamics Axapta 2009

Page
3


IAxapta

and
IAxapta2

are not available in Microsoft Dynamics AX 2009.

In addition to COM support, the Business Connector contains .NET classes for Microsoft Dynamics AX
functionality. The documentation for .NET classes is located in the Microsoft Dynamics AX .NET Framework
section of the Microsoft Dynamics AX Developer Help.


Enterprise Portal


Microsoft Dynamics AX now supports Windows SharePoint Services. Use it to create a Web site that
provides access to Microsoft Dynamics AX data and functionality, such as forms, reports,

and menus. For
more information, see
Enterprise Portal for Microsoft Dynamics AX
.

Report Builder


Create Microsoft Dynamics A
X reports by using Report Builder for Microsoft SQL Server Reporting Services.
You add information to the report from a report model.

Organize information for a report model by creating a perspective in the Application Object Tree (AOT).
You can also use
table, view, and extended data type properties in the AOT to determine the availability
and organization of information in a report model.

For more information, see
How to: Cre
ate a Perspective for a Report Model (MorphX Reporting Tools)
.

Application Integration Framework


Send and receive XML data between Microsoft Dynamics AX and external software systems by using the
Applicat
ion Integration Framework (AIF). AIF enables business
-
to
-
business scenarios, application
-
to
-
application scenarios (A2A), and enterprise application integration (EAI) projects.

Table Permissions


The
AOSAut
horization

table property enables you to specify the type of operation that a user can perform
on a table, depending on the user's permissions.

For more information about table permissions, see
Table Permissions
.

For more information about user permissions, see
Restrict Access to Tables and Fields
.

Optimistic Concurrency Control


Specify whether the optimistic concurrency control is enabled for a table by setting the
OccEnabled

property on a table or calling the
DictTable.
occEnabled

method.

When this mode is enabled, data is not locked from future modification when it is fetched from the
database. Data is locked only when the actual update is performed.

For more information, see
Optimistic Concurrency Control
.

Microsoft Dynamics Axapta 2009

Page
4


Int64 and GUID Data Types


X++ now has the following integers:



int



32
-
bits wide



int64



64
-
bits wide

For more information, see
Integers
.

A
guid

data type has also been added. You can generate a GUID by using the
newguid

function,

and convert
strings to GUIDs and GUIDs to strings by using the
str2Guid Function

and
guid2Str Fun
ction

functions.

Identifier Names


In Microsoft Axapta

3.0 and earlier versions, it was possible to use any character in the ASCII extended
character set. For example, identifiers like
überAlles

and
ridicu


were valid. You can now use only the
standard ASCII character set.

Record IDs


When Microsoft Dynamics AX inserts records into SQL tables, a unique record ID is assigned to each
record

regardless of the company each record is associated with. The record ID is now an
int64

data type
value. The range in which record IDs are allocated i
s from 5637144576 to 2^63 (9223372036854775808).

You can use the
systemSequence

class to control the system generation of record IDs.

Unit Testing Framework


Microsoft Dynamics AX now has an integrated Unit Test Framework built into the MorphX development
environment. Unit tests are made as individual test cases. Each test can include a num
ber of tests in the
form of assertions. Test cases can be contained within test suite classes or as part of a project in MorphX.
Testing can be done from the Unit Test toolbar from which individual test cases, test suites, or test projects
can be executed.

Test results can be viewed from the Unit Test toolbar that indicates the test passed or
failed state, per case and test, and can even include code coverage measures for the classes and methods
that are tested.

2
-
tier Deployment No Longer Available


2
-
tier, 3
-
tier thick, and Web deployment are no longer available in Microsoft Dynamics AX. The only option
is a 3
-
tier configuration with a thin client.

Unicode


The Microsoft Dynamics AX code base is now Unicode
-
compliant.

The
TextIO

and
CommaTextIO

classes replace the
AsciiIO

and
CommaIO

classes, respectively, to support
file I/O for non
-
ANSI code page characters.

Microsoft Dynamics Axapta 2009

Page
5


New Development Best Practices Checks


For a description of the new MorphX and X++ best practices checks in Microsoft Dynamics AX, see
New
Best Practices in Microsoft Dynam
ics AX 4.0
.

SysAutoRun Configuration Framework


The
SysAutoRun

class enables system administrators to configure Microsoft Dynamics AX by supplying the
client with an XML file that contains configuration co
mmands. The framework can also be used for testing
purposes and to run custom code when Microsoft Dynamics AX starts. For more information, see
SysAutoRun Class
.

Kernel Redesign


As a result of some redesign of several kernel areas, kernel performance has been augmented. This
redesign has resulted in the improvement of the following areas:



Enhanced performance when multiple clie
nts are run against AOS servers



Improved report handling



More efficient IO caching, reducing the cost of cross
-
client synchronization

Debugger Enhancements


The debugger in Microsoft Dynamics AX has rece
ived a number of enhancements that include the
following:



A new workbook UI that has an optional multiple
-
document interface (MDI) mode



Ability to sort on columns in docking windows



Line numbering in the code editor



Tool windows layout persistence betw
een sessions



New Breakpoints and Call Stack windows



Watch window improvements, such as
Clear Current Watch

and
Clear All Watches




Ability to copy tool window contents to the Clipboard



New icons that match the best format of the operating system that the debugger is running on



Shortcut keys that are aligned with the Microsoft Visual Studio 2003 debugger



A new debug command,
SetNextStatement
, that enables you to set the execution point
to a
particular line of code



Menus standardized for all tool windows

Reverse Engineering Tool


Reverse engineering of MorphX is a feature that enables partners to straightforwardly retrieve detailed
infor
mation about the structures and relationships of the Microsoft Dynamics AX business logic and data
model. This information is retrieved by integrating the data and object model evaluation with Microsoft
Office Visio 2003. This enables a developer to utiliz
e a true modeling concept, which can be the foundation
for customization and integration.

The Reverse Engineering tool renders the Visual MorphXplorer tool obsolete. It has been removed.

Microsoft Dynamics Axapta 2009

Page
6


Image Manipulatio
n


The AccuSoft ImageGear graphics library that is used by Microsoft Dynamics AX has been replaced by the
Microsoft Windows GDI+ (Graphics Device Interface) library. Functionality is unaffected. Some of the rarely
used methods on the
Image

and
Imagelist

classes are no longer available.

Cross
-
References

are Name
-
Based


Cross
-
references to other Microsoft Dynamics AX objects are now name
-
based and no longer ID
-
based. If
you rename an object, update all the references to it. For more information, see
How to: Rename AOT
Objects in the Version Control System
.

Changes in XPO Files


XPO files no longer have a time stamp. To see the date of an object, use the
version control system
.

XPO files no longer contain default values for properties. They are included in the file only if they have been
changed from the default value, making files smaller. It also mak
es it possible to make a global change in a
property's default value.

Layers


The GLS layer has now been merged into the SYS layer. A new SE layer has been introduced. The IDs for the
SYS layer are now 1
-
1
4000. The IDs for the SE layer are 14001
-
16000.

Trailing Zeros


It is now possible to hide trailing zeros when displaying real numbers in a field control. Trailing zeros are
hidden only in the user interfa
ce. The value stored in the database doesn't change.

To remove trailing zeros, use the
MinNoOfDecimals

property on the form control. For more information,
see
Form Control
Properties
.

The MorphX Recycle Bin Has Been Removed


The recycle bin in MorphX (introduced in Axapta

3.0), which was used to hold deleted AOT objects, has
been removed for Microsoft Dynamics AX.

Feature Keys Removed


Feature keys were replaced by security keys and configuration keys in Axapta

3.0.

All code relating to feature keys has been removed from Microsoft Dynamics AX.

Documentation Changes


The following changes have been made to Microsoft Dynamics AX documentation for developers.

Microsoft Dynamics Axapta 2009

Page
7


New SDK

The Developer's Guide, Developer's Best Practice Handbook, Debugger Guide, and X++ r
eference
information are now all in one HTML Help file. The file is available from the
Help

menu in Microsoft
Dynamics AX and when you press F1 on an application object in the AOT.

All SDK topics include a feedback mechanism, which you can use to rate the

topic or send an e
-
mail.

Continuous Publishing Model

The SDK will be continually updated to respond to feedback and requests, and to provide additional
information.

Updates to topics will be provided on
MSDN
. Updated topics can be accessed with the link at the end of
each topic in the HTML Help file.

Changes will periodically be assembled into a new version of an HTML Help file. The latest version of the
SDK is available at
Using Microsoft Dynamics AX
.

Class and Table Documentation

Documentation has been provided for some of the most frequently used system (kernel) classes.

Basic information has been provided for a
ll X++ tables.

This information is available in the
Reference

section of the SDK.

Getting Started

This section has information about the Microsoft Dynamics AX development environment for both new and
experienced developers.

This section has a walk
-
through of a customization in Microsoft Dynamics AX and a list of programming
references.

Security

Trust
worthy Computing has been a focus for the Microsoft Dynamics AX release. The SDK documentation
has been updated with information about
X++ Security

and with security notes in th
e documentation for
classes and tables that could be used in an insecure manner.

Enterprise Portal

The documentation for the Enterprise Portal feature provides instructions for tasks, such as creating Web
site pages, customizing the user interface by crea
ting weblets, and modifying the appearance of Web sites
by creating themes. For more information, see
Enterprise Portal for Microsoft Dynamics AX
.

Development Best Practices

Th
e Developer's Best Practice Guide has been updated. It now forms an integral part of the SDK. For more
information, see
Best Practices for Microsoft Dynamics AX Development
.

Microsoft Dynamics Axapta 2009

Page
8



1
.2
What’s new in Microsoft
Dynamics AX 2009


The following information provides descriptions about many of the features that are available in
Microsoft Dynamics AX. Updated and additional developer documentation for Microsoft Dynamics
AX can be found at th
e
Microsoft Dynamics AX Developer Center

on the Microsoft Developer
Network (MSDN). The following features are described in this document:

Layers


Workflow


Business Connector


Development Best Practice Checks


Version Control System Integration


XML Documentation


Enterprise Portal


Reporting Tools for Microsoft Visual Studio


Reverse Engineering Tool


Navigation Pages


Queries and Views


Time Zone Support


Compos
ite Query


Cross
-
Company Support


X++ SQL Enhancements


X++ Enhancements


Debug a Batch that Runs on the AOS


Update Cross
-
reference by Using AT.exe


E
-
signature Subsystem Support


Application Integration Framework


MorphX


Business Intelligence


Documentation Changes


Microsoft Dynamics Axapta 2009

Page
9


Changes in
SP1


Layers


Three new solution layers, SL1, SL2, and SL3 have replaced DIP, LOS and LOP to enable deployments
of Microsoft Dynamics Industry Solutions (MDIS). Each solution is deployed in separate layers. When
upgrading, the new layer is installed using standard Micro
soft Dynamics AX tools. This will enable
customers to install more than one MDIS solution. Only MDIS partners will be able to write solutions
in the SL1, SL2 and SL3 layers.

The DIS layer is renamed to HFX. The HFX layer can be used for hot fixes. For mor
e information, see
Application Object Layers
.

There are now 8 layers which share IDs 1


20000. Application object IDs are now combined and
allocated for the layers as shown in

the following table.

Layer

Application object ID range

SYS

1
-
20000

SYP

1
-
20000

GLS

1
-
20000

GLP

1
-
20000

HFX

1
-
20000

SL1

1
-
20000

SL2

1
-
20000

SL3

1
-
20000

Workflow


The Microsoft Dynamics AX workflow infrastructure enables user configurable workflows in
Microsoft Dynamics AX application modules with specific focus on task and approval workflows. The
workflow runtime manages configuration and execution of workflows whi
le the application modules
will manage activation and business logic associated with workflows.

There is a new node in the Application Object Tree (AOT) named Workflow. Within the workflow
node, you can create workflow templates, categories, tasks, and ap
provals. Workflow templates are
Microsoft Dynamics Axapta 2009

Page
10


the basis for creating workflow configurations in the application. The workflow template defines the
data fields that the workflow operates over, tasks and approvals, and event handlers to run business
logic during the workf
low. The workflow category determines whether a workflow template is
available in a specific module. Workflow tasks are single step units of work defined in the AOT.
Workflow approvals are specialized tasks that can contain many steps, and support an appro
val
process. For more information, see
Implementing Workflow for Microsoft Dynamics AX
.

Microsoft Dynamics AX workflow has three workflow providers. The due date provider is us
ed to
select a date and time for completion of a workflow, workflow task, or workflow approval step
based on the calendar set up in Microsoft Dynamics AX. The participant provider resolves
assignment of a workflow to a user group. The hierarchy provider re
solves assignment of a workflow
to a user within a user group based on conditions set up by the user.

Business Connector

:

COM Business Connector is no longer going to be supported in a future release. If
you need to install
COM Business Connector, you must install from the command line. For more information, see
How
to: Install COM Business Connector using Command
-
line Options
.
For information about .NET
Business Connector, see
.NET Business Connector Overview
.

Development Best Practices Checks


For a
description of the new MorphX and X++ best practices checks in Microsoft Dynamics AX, see
New Best Practices in Microsoft Dynamics AX 2009
.

Version Control System Integration


MorphX, the Microsoft Dynamics AX Integrated Development Environment, can now integrate with
more version control management systems.

Features for Microsoft Visual Studio Team Foundation Server (TFS) version control include
concurrent development, isolated development, change description, change history, change list
support, and quality bar enforcement.

MorphX VCS, which is included wit
h Microsoft Dynamics AX, provides out
-
of
-
the
-
box version control.
Features for MorphX VCS include change description, change history, and quality bar enforcement.

For more information about version control options, see
Version Control System
.

XML Documentation


You can now write XML documentation in X++ source code to document classes, class methods, and
table methods. This XML
documentation can be extracted from the source code to create an XML
documentation file. For more information about XML documentation, see
XML Documentation
.

Enterprise Portal


A new framework is being used for Enterprise Portal. By using this new framework, controls for
Enterprise Portal are developed in Visual Studio. For information about how to develop for
Microsoft Dynamics Axapta 2009

Page
11


Enterprise Portal,
see
Enterprise Portal Development Overview
. For information about how to use
Visual Studio to develop controls for Enterprise Portal, see
User Controls Overview
.

Reporting Tools for Microsoft Visual Studio


Microsoft Dynamics AX provides a model
-
based approach for creating reports by providing project
templates and modeling tools that are incorporated into the Microsoft Visual Studio development
environment. The reporting tools provided by Microsoft Dynamics
AX are based on a tight
integration with SQL Server Reporting Services. The reporting tools allow you to do the following:

Create reports quickly using the auto design reporting feature. This feature automatically creates a
report design based on the repo
rt data. Most reports can be created this way.

Use SQL Report Designer for reports that require a very precise design. SQL Report Designer can be
launched directly from within your reporting project in Microsoft Visual Studio.

Create a consistent look an
d feel for your reports using style templates. One style template can be
applied to many reports. Style templates allow you to separate the style settings from the actual
report definition. There are several predefined style templates available. These are
standard
templates for Microsoft Dynamics AX reports created with the reporting tools in Microsoft Visual
Studio.

Preview reports at design time from within the Microsoft Visual Studio development environment.

Write business logic for your reports in man
aged code.

Choose from several different data region types. You can choose from list, table, and matrix data
regions. In addition, several chart data region types are supported, including column, bar, line, pie,
and doughnut charts.

Add interactive repor
t features. You can add parameters and filters to sort and filter data, document
maps that users navigate to different areas of a report, drill
-
down and drill
-
up actions to allow users
to expand and collapse areas of data, and drill
-
through reports to allo
w users to drill through to
additional data in another report.

Display images in your reports.

Develop your reports in a neutral language, and then create translated versions of the resource files
when you are ready to localize your reports. Standard .NE
T Framework localization techniques are
used to localize the resource files in a reporting project.

Use the deployment utility that is installed with the reporting extensions to deploy reports to a
report server.

For more information about the reporting
tools for Microsoft Visual Studio, see
Reporting Overview

and
Creating Reports for Dynamics AX in
Visual Studio
.

Reporting projects created with the reporting tools for Microsoft Visual Studio can be integrated into
Microsoft Dynamics AX. Reporting projects are added to the AOD in a packaged format. This allows
the reporting projects to be customized,

upgraded, and patched using the built
-
in layering support.
Microsoft Dynamics Axapta 2009

Page
12


Reports can display from menus and forms in the Microsoft Dynamics AX client and in Enterprise
Portal Web parts. For more information, see
Report Integration Overview
.

Reverse Engineering Tool


The Reverse Engineering Tool supports a new model type. You can now use the Reverse Engineering
Tool to generate an .erx file th
at can be used to create an entity relationship (ER) data model. An ER
data model describes the data in a system and provides a means of visualizing tables, views, and
their relationships. You can import an .erx file into modeling tools, such as Microsoft
Office Visio and
CA ERwin Data Modeler, where you can create an ER data model from the imported elements. For
more information, see
Reverse Engineering Tool Overview
.

Several a
dditional properties have been added to the Properties sheet to aid in describing
application elements. The DeveloperDocumentation and EntityRelationshipType properties have
been added to the Properties sheet for tables, views, and maps. The EntityRelation
shipRole property
has been added to the Properties sheet for table relations. These properties are helpful in describing
application elements and how they relate. The descriptions for these properties are captured in the
.erx file that is generated from th
e Reverse Engineering Tool and can be used in describing the
elements within an ER data model.

Navigation Pages


Microsoft Dynamics AX contains new types of forms that you use to view data records and open

forms. The new types of forms are known as navigation pages. Navigation pages include the
following types of pages:

A primary list page retrieves and displays a list of data records in the client content pane. A list page
also contains an action pane, a
filter pane, and optional controls like a preview pane. The action
pane contains buttons that perform an action on one or more list page records.

A secondary list page builds upon an existing list page but modifies the list page data source. The
new data source includes data constraints that cause the secondary list page to display a subset of
the records from the original list page.

A content page

enables the client content pane to display data in a format other than a list. For
example, a content page can use a tree control to represent the organizational hierarchy of a group
of records

An area page contains menu items that open list pages, conte
nt pages, forms, reports, classes, jobs,
and queries.

To access a navigation page, use the client Navigation Pane or an area page to find and open a
specific list page or content page. For more information, see
Navigation Pages in Microsoft Dynamics
AX
.

Queries and Views


Microsoft Dynamics Axapta 2009

Page
13


The AOT includes changes to the view and query objects that enable more flexibility in how you
retrieve reco
rds from the database. To enable flexibility, the following changes were made to
queries and views:

The AOT query object enables the construction of a query that represents the union of two or more
existing data sources. A union retrieves the same type of

data from each data source. You can
specify whether the query should remove or retain duplicates records. For more information, see
How to: Combine Data Sources
.

The AOT query

relation enables more flexibility to define how to join two data sources. The query
relation enables you to specify the data source you want to join with the current data source. For
more information, see
Query Elements in the AOT
.

The AOT view object lets you use a query as a view data source. New views should always use a
query for a data source. For more information, see
View Overview
.

Time Zone Support


Microsoft Dynamics AX 2009 introduces time zone support. While on a business trip, David enters
sales information in his local time. Then Susan can view the sales information with the date/time
values automatically adjusted to her local time.

For more inf
ormation, see the following topics:

Time Zone Overview and Terminology


utcdatetime


DateTimeUtil Class


datetime2str Function


"Walkthrough: Upgrading Date and Time Table Field Pairs into UtcDat
eTime" in AxUpgradeGuide.pdf

Note

The AxUpgradeGuide.pdf file is available at the
Microsoft Dynamics AX Online

web site.

Composite

Query


In the AOT, a query that uses another query as its data source is called a composite query.
Composite queries are new in Microsoft Dynamics AX 2009. A composite query is a way to improve
the reuse of code and objects. You can add ranges to a composite quer
y, and you can override
methods of the original query. A composite query or a regular query can be the data source for
other AOT objects such as forms, reports and views.

For more information, see
Query Framework in the AOT
.

Cross
-
Company Support


Microsoft Dynamics Axapta 2009

Page
14


A cross
-
company query can return data for several companies in a single run. A query does not have
to be limited to returning data fo
r the current session company. Central to this functionality is the
new X++ keyword crossCompany, and the new property AllowCrossCompany on Query objects in the
AOT.

For more information, see
Cross
-
Company Data Access
.

Note

The DataAreaId length has been increased from 3 characters to 4 characters.

X++ SQL Enhancements


The SQL statements in X++ have been enhanced to bring them closer to the functionality of industry
standard SQL. The enhancements include better support for inner and outer join clauses, better
group by and order by clauses, and better support or using var
iables as a source of data to be
inserted or updated. For more information, see the following topics:

Select Statement Examples


insert Table Method


update_recordset


X++ Enhancements for CLR Interop


The following enhancements have been made to the X++ language. These enhancements increase
the support for common language runtime (CLR) interoperability.

byref Keyword

Support for calling .NET Framework assemblies, those managed by the common language ru
ntime
(CLR), has been enhanced by the addition of the byref keyword. This enables you to write X++ code
that calls a C# method that requires either an out or ref parameter.

For more information, see
How to: Use the byref Keyword for CLR Interop
.

.NET Framework Array Support

X++ provides syntax for declaring and allocating arrays of .NET Framework common language
runtime (CLR) primitive data types. For more information, see
How to: Use X++ Syntax for CLR
Arrays
.

.NET Framework Enum Support

In Microsoft Dynamics AX 2009, you are now able to reference the members of .NET Framework
enum types. For more i
nformation about accessing static members of a managed type, see
How to:
Access Static and Instance Members of .NET Framework Classes
.

Debug a Batch Job that Runs on the AOS


Microsoft Dynamics Axapta 2009

Page
15


In previous versions of Microsoft Dynamics AX, each batch job ran on the dedicated client. In
Microsoft Dynamics AX 2009, the default is for each batch job to run on the Application Object
Server (AOS). Yet
the developer might want to debug the batch from his client computer. The utility
AxDebug.exe can now do this. For information on how to debug a batch that is running on the AOS,
see
Walkthrough: Debugging a Batch that Runs on the AOS
.

Update Cross
-
reference by Using AT.exe


The batch system cannot update cross
-
reference information in Microsoft Dynamics AX 2009. The
Microsoft Windows Task Scheduler interface (or AT.exe) can be used to run a cross
-
reference update
beginning in the late evening, so it completes before morning.
For more information, see
How to:
Schedule Cross
-
references Without a Batch
.

Electronic Signature Support


Microsoft Dynamics
AX 2009 SP1 provides a system for capturing and for processing electronic
signatures. The system provides several built
-
in signatures, such as Bill of Material Approval.

You can enable the built
-
in signatures by using the Electronic signature requirements

form. This form
also enables the administrator to define new signatures for tables or fields. Defining new signatures
requires careful planning to avoid excessive security which could block proper access to tables.

For more information about using built
-
in signatures or defining new signatures, see "Electronic
signature requirements (form)" in System and Application Setup Help. In the SP1 edition of the Help,
see "Generic electronic signatures".

Applicati
on Integration Framework


Application Integration Framework (AIF) enables companies to integrate Microsoft Dynamics AX and
communicate with external business processes and partners through the exchange of XML over
various transport media. AIF enables both
business
-
to
-
business and application
-
to
-
application
integration scenarios. Enhancements to AIF in Microsoft Dynamics AX include the following:

Create, read, update, and delete (CRUD) operations are now supported. The ability to update and
delete data thro
ugh AIF enables companies to fully integrate Microsoft Dynamics AX in their
business processes.

The programming model for AIF supports document services that encapsulate business logic and are
the interface between Microsoft Dynamics AX and external syste
ms. The document services can be
customized by adding your own methods. Microsoft Dynamics AX now supports the ability to expose
business logic implemented in X++ as Windows Communication Foundation (WCF) services. All
services can be published through AIF

asynchronous adapters or through WCF.

AIF provides functionality for consuming external Web services from within X++. This enables the
integration with any external data provided as a Web service.

Performance improvements include the ability to scale up

and handle more messages through
parallel message processing and the addition of multiple AOSs.

Microsoft Dynamics Axapta 2009

Page
16


New document services for additional commonly
-
used documents.

For more information about AIF for developers, see
Application Integration Framework Overview
.
For more information about setting up AIF, see "Configuring and managing AIF" in the
Server and
Database Ad
ministration Help
.

Update and Delete

AIF now supports the ability to update and delete data in Microsoft Dynamics AX through document
exchange. Two new actions enable the ability to update or delete a single record or multiple records.
The Axd Wizard is n
ow the AIF Document Service Wizard and enables developers to create custom
documents that support updating and deleting data.

Programming Model Changes

Documents are now exposed as services making them more flexible and customizable. Service
operations ca
n now be consumed from external AIF clients as well as directly from X++ code. The AIF
framework has been updated to enable developers to expose X++ business logic as WCF services.
ASMX Web services have been replaced with WCF services enabling new functio
nality such as
message encryption.

Consume Web Services

Microsoft Dynamics AX provides the ability to consume Web services from within X++. Creating a
service reference to an external Web service generates a .NET service proxy that enables the service
to
be available through IntelliSense within X++. The external Web service can be consumed by
Microsoft Dynamics AX using the .NET service proxy through CLR interop.

Performance

AIF now supports the ability to scale up message processing when using the AIF ad
apters by adding
AOSs. You can now define whether messages are processed sequentially or in parallel. If parallelism
is implemented, messages can be processed in any order by multiple AOSs. After implementing
parallel message processing, specific messages
can still be designated for sequential processing.

New Documents

AIF includes support for an enlarged set of frequently used documents. Documents new to Microsoft
Dynamics AX include the following.

Document

Supported service operations (Create, Read, Up
date, Delete)

Address

CRUD

Bill of Materials (BOM)

CR

Microsoft Dynamics Axapta 2009

Page
17


Cash Discount

R

Contact Person

CRUD

Credit Card

C

Customer

CRUD

Customer Group

R

Customer Payment Journal

C

Expense Report

CR

Fixed Asset

CRU

Fixed Asset Condition

R

Fixed Asset Group

R

Fixed Asset Location

R

Fixed Asset Major Type

R

General Journal

CR

Inventory profit/loss journal

C

Item

CR

Item Dimension (Color)

R

Item Dimension (Configuration)

R

Microsoft Dynamics Axapta 2009

Page
18


Item Dimension (Size)

R

Item Dimension Combination

R

Payment Terms

R

Product Groups

R

Product Picking List

C

Project Hour Journal

C

Project Invoice

R

Return Order

CR

Return Order Acknowledgment

R

Route Card

C

Sales Invoice

R

Sales E
-
Invoice

R

Service Agreement

R

Service Order

CRUD

Shipping Methods

R

Route Card

C

Unit

R

Microsoft Dynamics Axapta 2009

Page
19


Unit Conversion

R

Vendor

CR

Vendor Group

CR

Vendor Payment

R

Warehouse

R

In addition to these new documents, the sales order document has been updated to support multi
-
site functionality as well as the ability to update and delete data.

Partners and customers can easily customize and extend the existing application programming

interfaces (APIs) by using the Microsoft Dynamics AX software development kit (SDK). The SDK
includes a new service wizard that developers can use to easily create their own custom document
services.

MorphX


Several usability enhancements and new features were added to the MorphX development
environment. These enhancements address developer pain points to improve the development
environment usability and to help increase developer productivity.

The fo
llowing features were added to the AOT:

AOT caption that contains the path of the selected object.

Support for table field drag
-
and
-
drop operations between tables.

Find
-
as
-
you
-
type support to Property sheet drop
-
down lists.

Enhanced menu navigation for the Add New menu in Projects.

The following enhancements were made to the X++ Editor:

Removed the limit to the number of Undo actions.

Increased the default window size.

The Embedded Resources tool was updated and added to
the Development Tools menu.

The following table contains keyboard shortcuts that were added to the development environment.

Command

Shortcut key

Microsoft Dynamics Axapta 2009

Page
20


Compare

CTRL+G

Projects

CTRL+Shift+P

Open new workspace

CTRL+W

Import

CTRL+Shift+I

Version control parameters

CTRL+Shift+V

Business Intelligence


The Business Intelligence infrastructure enables you to generate Unified Dimensional Models
(UDMs) by leveraging metadata from the Microsoft

Dynamics AX relational data model. You can
specify measures and dimensions in the AOT to define Online Analytical Processing (OLAP) cubes. A
perspective is used to identify the tables that contain measures and dimensions for a cube. You can
generate a Bus
iness Intelligence project and manage and customize the cubes using SQL Server
Business Intelligence Development Studio. For more information, see
Defining Cubes in Microsoft
Dy
namics AX

and
Working with Business Intelligence Projects
.

Documentation Changes


The following changes have been made to the documentation for developers in Microsoft Dynamics
AX 2009:

New scenario
-
based documentation

The documentation for Microsoft Dynamics AX 2009 contains more "How to" topics and
walkthroughs. These topics take yo
u step
-
by
-
step through various tasks in the development
environment.

Class and table method documentation

Reference documentation has been added for many class and table methods. We know that there
are still gaps and we will be publishing updates to the
reference documentation on MSDN.

Improved table documentation

The reference topics for tables now contain a description that explains what each table is used for.
These topics also contain information about the table methods, fields, relations, and index
es.

Help also available in Visual Studio

Development for the Enterprise Portal, Reporting, and the .NET Business Connector is performed in
Visual Studio and in MorphX. So the help for those components is available in both tools.

Microsoft Dynamics Axapta 2009

Page
21


More documentation for l
egacy features

We have continued to add new documentation on MSDN since the release of Microsoft Dynamics AX
4.0. All this new content has been incorporated into the product documentation for Microsoft
Dynamics AX 2009.

Changes in Microsoft Dynamics AX 2009 SP1


Microsoft Dynamics AX 2009 SP1 introduces different functionality for the partial update in AIF. For
more information about updating data using AIF, see
Update Action Rules in AIF
,
Example: Update
Action
, and
Walkthr
ough: Updating Data with AIF (Full Update)
.

The AxUpdatePortal utility has been added to make deploying additions and modifications for
Enterprise Portal easier. For more information, see
AxUpdatePortal Utility
.

1.3
Getting Started Scenarios in Microsoft Dynamics AX

This section includes procedure topics that describe a realistic customer scenario that uses the
development environment in Microsoft Dynamics AX. You can use the scenario as a base for your own
solution or as a tool to see how parts of the development env
ironment work together.

This section contains the following topics:

Walkthrough: Getting Started with Customizations

Customizing forms and customizing reports in MorphX are among the most common development tasks
you perform in Microsoft Dynamics AX. This topic walks you through a scenario in which you customize the
SalesTable

table by adding a new field to one of the
Sa
lesTables

field groups. Adding this field to the
group makes the field visible on the
SalesTable

form. Next, you create and add a similar field to the
CustInvoiceJour

table and to the
SalesInvoice

report. This allows you to create a new sales order and fil
l in
the new field. When you post the sales order, you see the text from the new field on the invoice.

Note

To go through this scenario you need to have your own
l abel fi l e
.

The following steps walk you through the scenario.

Changing the Current Development Layer


MorphX supports layered development. Layered development enables you to easily identify your changes
because t
hey are located in a layer above the existing functionality. This feature eases the process of
upgrading from one version to another. For more information, see
Application Objec
t Layers
.

There are two layers that are used for making customizations in Microsoft Dynamics AX: the bus layer and
the cus layer. The bus layer is used for implementing customizations that apply to all of your customers.
This scenario walks you through a
customization for a single customer, so you work in the cus layer.

Microsoft Dynamics Axapta 2009

Page
22


Change the Current Development Layer

1.

Click
Start

>
Control Panel

>
Administrative Tools

>
Microsoft Dynamics AX Configuration
Utility
.

2.

On the
Development

tab, select
cus

from the drop
-
dow
n list in the
Application object layer to
open

field, and then click
OK
.

Note

The configuration utility runs outside Microsoft Dynamics AX. You must stop and restart the client for the
changes to have effect.

Opening the Development Environment


MorphX is the name of the development environment in Microsoft Dynamics AX. The main view of the
programming environment is the Application Object Tree (AOT). The AOT cont
ains all of the application
elements in the application, and it contains
tools

to develop your own application or to modify the existing
modules.

Open the AOT



Press CTRL+D.

Creating an Extended Data Type


Before you create a new field on the
SalesTable

table, you need to create an extended data type to base
the new field on.

Extended Data Types

are user
-
defined types, based on the primitive data types
Integer
,
Real
,
String
,
Guid
,
int64
,
Time
,
Enum
, and
Date
, and the composite data type
Container
. You can also base extended data types
on other extended data types.

A major advantage of using extended data types is that they model higher level abstractions than primitive
data types do. An extended data type named "StreetName," for example, has much

more semantic
meaning than the primitive type string. Use extended data types instead of primitive data types whenever
possible. Using extended data types includes using them when you are writing X++ code and when you are
creating your data model. A
best practice

in Microsoft Dynamics AX specifies that all table fields must be
based on an extended data type.

Another major advantage of using extended data types is that an extend
ed data type has a set of
properties, such as the user interface text (labels) and Help text. Any table field that is based on a particular
extended data type inherits these properties, so the developer has to update only one location to update
type proper
ties for all fields of that type. To view these
properties
, right
-
click the element in the AOT, and
then click
Properties
. For more information, see
Extended data type properties
.

Create an Extended Data Type Based on a String

1.

Expand the
Data Dictionary

node, right
-
.click the
Extended Data Types

node, and then select
New

>
String

in the shortcut menu.


Microsoft Dynamics Axapta 2009

Page
23


2.

Right
-
click the new extended data type, click
Properties
, and then type
DeliveryText

in the
Name

field.

It is a
best practice

in Microsoft Dynamics AX to base all UI text on labels. You must use a label because this
extended data type will be used to create a field in a table that will be shown on a form and a report. Also,
placing the label on the extended data type ensures tha
t the label is inherited by any element that is based
on this extended data type.

To add new labels,
create your own label file
. Having your own labels stored in a separate file facilitates the
translation and upgrade process.

1.

Create a label and add it to the properties form of the extended data type.

a.

Type
DeliveryText

in the
Label

field of the property sheet.

b.

Click the browse
button in the
Label

field. This opens the
Label editor
.

c.

In the
Label editor
, click the
Setup

tab, and then select your label file from the
Label file
ID

field. Select your own label file.

d.

Click the
Label

tab, and then click
Find now
.

e.

Press CTRL+N to create a new label, and then enter a description in the
Description

field.
Press CTRL+S to save the label.

Note

Entering a description in the
Description

field specifies the semantic use of the label. The semantic use of
the label distinguishes it from other labels with the same text string and provides contextual information to
translators.


f.

Click
Paste label
.

2.

To save the changes to the property sheet, select the extended data type, and then press CTRL+S.

Adding a New Field to an Existing Table


In MorphX, you can add fields to existing tables. You now need to a
dd a new field based on the
DeliveryText

extended data type to the
SalesTable

table.

Add a New Field to the SalesTable Table

1.

Expand the
Data Dictionary

node in the AOT, and then locate and expand the
Tables

node.

Note

The system searches all available label files to check whether the text already exists as a label. This is to
ensure that identical labels are not accidentally created. The results of the search are displayed in a grid at
the bottom of the form.


Microsoft Dynamics Axapta 2009

Page
24


2.

Navigate to and expand the
SalesTable

tab
le node.

3.

Right
-
click the
Fields

node of the
SalesTable

table.

4.

Click
New
, and then select
String

as the primitive data type to base the field on. To base a field on
an extended data type, you must first choose the primitive data type that the extended dat
a type is
based on.

5.

To base the field on the
DeliveryText

extended data type, right
-
click the field and select
Properties
.

6.

Click the
ExtendedDataType

arrow in the property sheet, and then select the
DeliveryText
.

7.

To rename the new field, select the
Name

field, and then type
DeliveryText
.

8.

Select the new field in the AOT, and then press CTRL+S to save
DeliveryText

field.

Adding a Field to a Field Group


It is a
best practice

in Microsoft Dynamics AX that fields shown on the user interface are members of one or
more field groups. Field groups are a way to group logically related fields. Forms and reports are based on
field groups rather than on individual fields.

Note

Any
field that you add to a field group is applied to any form or report that is based on that field group.
For more information, see
Defi ni ng Fi el d Groups
.

Add the New Text Field

to the Delivery Field Group

1.

Expand the
Field Groups

node under the
SalesTable

table.

2.

Drag the
DeliveryText

field from the
Fields

node to the
Delivery

field group. The
DeliveryText

field will be displayed everywhere that the
Delivery

field group is refere
nced.

Note

You can open more than one AOT instance at a time. This can ease dragging and dropping elements from
one node to another node. To open another AOT instance, press CTRL+D.

3.

Press CTRL+S to save the changes.

Verifying the New Field on the Sales Order Form


Forms in Microsoft Dynamics AX have can have one or more data sources (Tables, Maps, Views) associated
with them. The
SalesTable

table is one of the data sourc
es that is associated with the
SalesTable

form. You
can open the form to confirm that the field is visible on the
SalesTable

form.

View the New Field on the Form

1.

In the AOT, expand the
Forms

node, and then navigate to the
SalesTable

form.

2.

Right
-
click the

SalesTable

form, and then click
Open
.

3.

Click the
Delivery

tab on the form header, and then identify the new
Delivery text

field.

Microsoft Dynamics Axapta 2009

Page
25


Adding a New Field to a Second Existing Table


You now need to add a simila
r field to the
CustInvoiceJour

table. The field should be based on the
DeliveryText

extended data type.

Add a New Field to the CustInvoiceJour Table

1.

Expand the
Data Dictionary

node in the AOT, and then locate and expand the
Tables

node.

2.

Navigate to and e
xpand the
CustInvoiceJour

table node.

3.

Right
-
click the
Fields

node of the
CustInvoiceJour

table.

4.

Click
New
, and then select
String

as the primitive data type to base the field on.

5.

To base the field on the
Delivery Text

extended data type, right
-
click the

field, and then select
Properties
.

6.

Click the
ExtendedDataType

arrow in the property sheet, and then select the
Delivery text
.

7.

To rename the new field, select the name field, and then type
DeliveryText
.

8.

Select the new field in the AOT, and then press CTRL+S to save the
DeliveryText

field.

Editing a Table Method


You now need to add a line of code to the
initFromSalesTable

method on the
CustInvoiceJour

tab
le that
populates the table with data from
DeliveryText

field in the
SalesTable

table.



In Microsoft Dynamics AX, tables are themselves application objects and have methods that allow a
developer to write code that performs operations on records in the table. You can add new methods
or override existing methods, such as
insert
,
write
, and
del
ete
. They are automatically invoked by the
runtime in Microsoft Dynamics AX. For more information about table methods, see
How to: Define
and Modify Table Methods
.

Modify the C
ustInvoiceJour.initFromSalesTable Method

1.

Navigate to and expand the
CustInvoiceJour

table node.

2.

Expand the
Methods

node, navigate to the
initFromSalesTable

method, and then add the
following line of
X++

as the last line (just before the closing brace):

this.DeliveryText = salesTable.DeliveryText;


Note

Adding this line populates the
Delivery text

field in
CustInvoiceJour

table with corresponding data from
the
SalesTable

table.

3.

Press CTRL+S to save the table modifications.

Adding a New Field to a Report Design


To display the data from the
CustInvoiceJour.DeliveryText

fi
eld on the invoice, add the field to the
generated design of the
SalesInvoice

report.

Microsoft Dynamics Axapta 2009

Page
26


Reports can have two types of designs: generated and autogenerated. Autogenerated designs
automatically position the data that is made available to the report in a predefined configuration. The
SalesInvoice

report does not use an auto
-
generated design beca
use it is very common to customize
invoices.

Whether the report uses fields or field groups to display its data depends on the type of design.
Autogenerated reports use field groups, and generated reports use fields. For more information about
report desi
gn, see
Best Practices for Report Design
.

Add a Field to the SalesInvoice Report

1.

In the AOT, navigate to and expand the
Reports

node.

2.

Navigate to and expand the
SalesInvoice

report.

3.

Check out the report.

4.

Click
DataSources

>
Query

>
DataSources

>
CustInvoiceJour

>
Fields
, and then navigate to the
DeliveryText

field.

5.

Open another AOT instance by pressing CTRL+D.

6.

Navigate to and expand the
SalesInvoice

report.

7.

Click
Designs

>
Standard

>
GeneratedDesign

>
PageHeader:Invoice
.

8.

In the first AOT window, drag the
DeliveryText

field to the
PageHeader:Invoice

group.

9.

To position the
DeliveryText

text on the report header, select the
Left

field and type
9
, and then
select the
Top

fi
eld and type
10
.

10.

Note

For more information about report properties, see
Report properties
.

11.

Press CTRL+S to save the changes to the report.

Verifying the Customization


Finally, you create a sales order, post it, and print out a sales invoice.

View the Text from the New Field on a Report

1.

Create a sales order.

2.

On the
Sales order

form, click the
Delivery

tab.

3.

Select the
Delivery text

field and type
Large Box
.

4.

Post the sales order.

a.

Click
Posting

>
Invoice
.

b.

Select the
Print invoice

field, and click
OK
.

5.

Confirm that the text that you entered in the
Delivery text

field appears on the report.

1.4
Development References

Microsoft Dynamics AX provides developers with all the tools and classes that they need to customize their
implementation. Development in Microsoft Dynamics AX is done in an object
-
oriented environment using a
language called
X++
.

The SDK provides you with the information that you need to work in the development environment. The
following table lists references for development in Microsoft Dynamics AX.

Reference

Description

Microsoft Dynamics Axapta 2009

Page
27


Greef, Arthur, et al.
Inside Microsoft
Dynamics AX 4.0
. Redmond, WA:
Microsoft Press, 2006

A developer's guide for Microsoft Dynamics AX. Covers the
X++ programming language, database, and customizing your
implementation.

Andreasen, Steen.
MORPHX IT
. Risskov,
Denmark: Steen Andreasen, 2006.

A programming book that covers the Microsoft Dynamics AX
development environment and X++ with downloadable code
samples.

For more general information about object
-
oriented programming, use the following referen
ces.

Reference

Description

Booch, Grady.
Unified Modeling Language User Guide
, 2d ed.
Reading, MA: Addison
-
Wesley, 1997

A guide on how to use the Unified
Modeling Language (UML).

Gamma, Erich, et al.
Design Patterns
. Reading, MA: Addison
-
Wesley, 1995.

Information about how to use design
patterns.

Howard, Michael, and David LeBlanc.
Writing Secure Code
, 2d
ed. Redmond, WA: Microsoft Press, 2002.

Information about techniques for writing
more secure code.

McConnel
l, Steve.
Code Complete
, 2d ed. Redmond, WA:
Microsoft Press, 2004.

A guide on programming style and
software construction.

Swiderski, Frank, and Window Snyder.
Threat Modeling
.
Redmond, WA: Microsoft Press, 2004.

A practical guide about threat modelin
g
and risk mitigation.

1.5
Videos for Developers in Microsoft Dynamics AX

At the
How Do I Video Series

Web site there is an up
-
to
-
date list of videos for developers on a variety of
topics about Microsoft Dynamics AX. There are videos for all levels from beginner to advanced developer.

To browse to the videos Web page, you start at the
Microsoft Dynamics AX Developer Center
. On the
developer center you click the
Learn

tab, and then click
How Do I Video Series
.

Channel 9 Videos


The
Channel 9

Web site has videos about Microsoft Dynamics AX. To find particular items on Channel 9,
click the
Search

menu on the Channel 9 home page. On the search page, enter
"Dynamics AX"

into the
Microsoft Dynamics Axapta 2009

Page
28


Term

field, a
nd select the
Blog Content

option button. Then click the
Search

button. The search results
contain videos on a variety of topics, and some are interesting to developers.

The following link automatically searches Channel 9 for items that contain the phrase

“Dynamics AX”:
Channel 9 search for “Dynamics AX”
.

The following link automatically scans Channel 9 for items that are tagged with “Dynamics AX”:
Channel 9
items tagged with “Dynamics AX”
.

Video How Do I: Link Parent and Child Forms by Using Dynamic Links?

On the
How D
o I Video Series

Web page under the
Microsoft Dynamics AX Developer Center

there is a video
that describes how to create a child form that automatically updates when the parent form changes.

Video title

Duration

Date
created

Authors

Content

How Do I:
Li nk Parent
and Chi l d Forms by
Usi ng Dynami c Li nks?


00:06:47

April 17,
2008

Gene
Milener

Microsoft Dynamics AX developers will learn
how to create a child form that automatically
updates when the parent form changes.

Video How Do I: Create a Simple
List Page in Enterprise
Portal?

On the
How Do I Video Series

Web page under the
Microsoft Dynamics AX Developer Ce
nter

there is a video
that describes how to create a child form that automatically updates when the parent form changes.

Video title

Duration

Date
created

Authors

Content

How Do
I: Create a
Si mpl e Li st Page i n
Enterpri se Portal?


00:04:52

June 26,
2008

Mey
Meenakshisundaram

Microsoft Dynamics AX developers will
learn how to create a simple list page in
Enterprise Portal by using the
AxGri dVi ew

control.

2.
Microsoft Dynamics AX

IDE

The integrated development environment (IDE) in Microsoft Dynamics AX is called MorphX. It includes tools
for designing, editing, compiling, and debugging
code in Microsoft Dynamics AX.

The programmable objects in Microsoft Dynamics AX

tables, forms, reports, classes, and so on

are
organized in a tree structure called the Application Object Tree (AOT). Creating and editing objects is
enhanced by drag
-
and
-
drop functionality, and by automat
ic settings for certain object properties. The
source code for methods on classes, tables, forms, and other objects is available to help you extend and
customize Microsoft Dynamics AX functionality.

Microsoft Dynamics Axapta 2009

Page
29


The concept of inheritance is central to the system

what

is defined at the lowest level can be inherited by
higher levels in the system. For example, if you change the length of a database field from 10 characters to
20, this change is automatically reflected on all forms in the application that displays this f
ield.

X++ is the programming language in Microsoft Dynamics AX. X++ uses object
-
oriented programming
principles, such as encapsulation, inheritance, classes, objects, methods, and properties. The X++ syntax will
be familiar to C# developers, and incorpora
tes SQL data manipulation statements.

Microsoft Dynamics AX uses a layering system where layers are a hierarchy of levels in the application
source code. This ensures that modifications and additions can be made without interfering with the
application ob
jects on other levels.

Microsoft Dynamics AX is not associated with a specific database platform, but has been designed to run
on top of a relational database, such as Microsoft SQL Server or Oracle.

2.1
MorphX Concepts

Some central object
-
oriented mechanisms and terms appear repeatedly as you develop with MorphX.
Below is a brief explanation of the most important ones.

MorphX
concept

What is it and how does it work?

System class

An interface to the functionality that is defined in MorphX, such as to creating or
running a form.

Class

Defines an object's interfaces. A class instructs or explains how to construct an object of
a particular type.

An essential characteristic of a class is that you can "new" it. This means that you can
create a new instance (an object) of the class.

Forms
are an example of a class. MorphX has a class definition that describes exactly
what happens when a form object is created.

Controls

A graphical object, such as a text box, a check box, a command button, or a rectangle,
that you place on a form or repor
t when you are designing it to display data, perform an
action, or make the form or report easier to read.

There are approximately 20 different controls and each is defined by about 50
properties.

Data Source

Holds the data variables that a form or a q
uery uses. These data variables can be one or
more tables, or they can be individual fields from tables.

Designs

Provides access to define the layout of a form or a report.

Encapsulation

The data in the system is hidden behind methods and can be changed only by the
Microsoft Dynamics Axapta 2009

Page
30


methods.

Final

A class or method modifier that defines that the class or method cannot be extended
(overridden).

Inheritance

A central concept in MorphX. It means that wha
t you define at lower levels in the system
is automatically inherited by higher levels.

An illustration of the hierarchy of inheritance is that your own methods can be built on
and extend one of the methods defined in MorphX. In the code this is indicated

by the
super reference.

You can always recognize an inherited method on the down arrow in the methods icon (
).

Method or
object method

Tasks that you can tell an object to do.

Methods can be programmed at several levels:



As part of a table



As part of a form

Methods for a form can be related to:



The general management of the form, such as running the form, or closing it



The data displayed in the form, such as deleting, or writing data



Form controls, such as moving the cursor



As part of q
ueries



As part of a general class library

Initially, the methods are only frames that activate the methods of MorphX (indicated by
the super() call).

The small icon in the tree structure indicates that there is, as yet, no user code in the
methods.

Whe
n you have added some code of your own, a small, colored indicator is displayed in
the icon. The color bar is green when your code has no syntax errors and red in cases
when your method has errors.

In a method you can:



Add code to be executed prior to the main action of the method.



Write you own method or let MorphX handle it (the super() call).



Add code to be executed after the main action of the method.

Object

The central MorphX concept. Any form or control is an object. The database is an object.

Objects are created from classes. An object is an instance of a class.

Objects provide a convenient, logical way to organize procedures and data. Objects are
encapsu
lated, which means that they contain both their code and their data.

Microsoft Dynamics Axapta 2009

Page
31


To use an object, you must keep a reference to it in an object variable.

Property

Properties are data that describe an object. Each type of object has different types of
properties. A method typically has only a few properties, one of which defines where it is
to run. Conversely, a control frequently has about 50 properties which define

position,
size, color, and so on.

Query

A query is a filter mechanism to retrieve the data you want to see from your database
tables.

Queries are typically used as the source of records for forms and reports.

2.2
Setting Development Options

You can set development options in Microsoft Dynamics AX on the
Microsoft Dynamics AX

menu, point
to
Tools
, click
Options
, and then click the
Development

tab. The following table describes the options for
development.

General

Description

Startup project

Load this project at startup.

Application
object layer

Use the Application object layers list to define the layer view on objects in the tree.



Show no layers



no obje捴s are labeled with layer indi捡tions.



Show all layers



all obje捴s are labeled with layer indi捡tions for all layers in
whi捨 they e硩st.



Show highest layer



all obje捴s are labeled with a layer indi捡tion for the highest
laye
r.



Show corrected layers



only obje捴s that have been modified in the 捵rrent
layer or a higher one are labeled and only with an indi捡tion for the highest layer.



Show all from corrected layers



only obje捴s that have been modified in the
捵rrent layer

or a higher one are labeled but with indi捡tions for all layers.

To learn about appli捡tion obje捴 layers, see
Application Object Layers
.

Message limit

Number of lines in the message window. When this limit is reached, the lines are
discarded.

To view the discarded lines, you can examine the objects log file in the systems main
directory. Log files are called <
first four letters from object
>comp.log, for

example
Bankcomp.log for the log file that results from a compile of the object called
BankAccountReconcile.

These log files are temporary and the file names are not unique.

The log file in the above example is overwritten when you next compile an objec
t called,
Microsoft Dynamics Axapta 2009

Page
32


for example, BankDepositSlip.

Development
warnings

Choose this if you want developer warnings during X++ code translation.

A warning is displayed if, for example, there are SQL statements that may result in inferior
performance. The following SQL statements result in a warning if a key does not exist on
the table myTable with the fields myField1 and myField2:

select * from my
Table where myTable.myField1==x && myTable.myField2==y;

Editor


Description

Overwrite
selected text

Check this if you want typing to replace selection in the X++ editor.

IntelliSense

Check this if you want to use automatic IntelliSense features in the X++ editor.

Insert at cursor

Enable insert mode (as opposed to overwrite mode) in the editor.

Debug

Description

Debug mode

Use the Debug mode list to define when the debugger is activated.



No: debugger is never activated.



On Breakpoint: debugger is activated when a breakpoint in the X++ code is
encountered.

Auto

Description

Auto
-
update

Enter the number of seconds the system should wait before initiating a new update cycle.

Entering 0 (zero) disables the systems update cycle.

An update cycle comprises three types of updates:



Auto
-
refresh



Auto
-
save



Garbage collection

When you have sp
ecified an interval here, you can enable or disable the three options
individually.

Auto
-
refresh

Check this if you want the system to update application objects automatically so objects
that are made by other users become available to all users. In addition, the system updates
lock indications in the Application Object Tree (AOT).

You can also refres
h manually by using the Refresh command in the shortcut menu, for
example on the Forms or the Queries nodes.

Note

Refresh is one of the three components in an update cycle, and is performed only when an
Microsoft Dynamics Axapta 2009

Page
33


update cycle interval is specified (the Auto
-
Updat
e option).

Auto
-
save

Check this if you want the system to save application objects automatically. When the
Auto
-
Save option is enabled, the system automatically saves the unsaved objects when you
exit.

Note

Automatic save is one of the three components in an update cycle, and is performed only
when an update cycle interval is specified (the Auto
-
Update option).

Garbage
collection
limit

Number of application objects that are no longer in use.

MorphX automatically performs garbage collection when the number that is specified here
is reached.

The system uses memory each time an application object is opened in the AOT. Unless a
value is specified here, application objects are never discarded from

memory.



An application object is considered open when:



The application object's node is expanded in the AOT, or



One of the application object's methods is open in the X++ editor, or



The application object's properties are displayed, or



The applicatio
n object is displayed in the visual form editor or in the visual
report editor, or



The application object is 'touched', that is, it has been changed but not yet
saved.

Note

Garbage collection is one of the three components in an update cycle, and is performed
only when an update cycle interval is specified (the Auto
-
Update option).

Trace

Description

Database trace

Choose this if you want the system to trace to the message window whenever the
database is accessed.

Client
-
Server
trace

Choose this if you want to include information about where classes are executed.

ActiveX trace

Choose this to enable tracing of ActiveX control events.

This means that all events that are fired by the ActiveX controls are logged in the message
window. Different ActiveX controls fire different events, but most ActiveX controls share a
common set of
events, such as MouseMove, MouseDown, MouseUp, KeyDown, KeyUp,
Microsoft Dynamics Axapta 2009

Page
34


and so on.

Property
sheet

Description

Sort
alphabetically

Choose this option to have properties sorted alphabetically when they are displayed in the
property editor.

2.3
Application
Object Layers

Application object layers hold everything that is displayed in the Application Object Tree (AOT). This topic
describes application object layers and how they are used in Microsoft Dynamics AX.

Layers are a hierarchy of levels in the application source cod
e that enable you to make modifications and
additions without interfering with the application objects in the next lower level. When you make an object
modification on one level, the modification overshadows the object on a lower level. You could, for
exam
ple, decide to add e
-
mail information to a standard form. The addition would be saved on your level
only. The revised form replaces the standard form. However, you can always return to the original form at
the next lower level by removing the new form.

Th
ree customer groups have an interest in adding and modifying application objects:



Application developers who create the standard application.



Business partners.



End users of Microsoft Dynamics AX.

The following table describes the application object layers in Microsoft Dynamics AX.

Layer

Description

SYS

The standard application is implemented at the lowest level, the SYS layer. The application
objects in the standard application can never be deleted.

GLS

When the application is modified to match country/region specific legal demands, these
modification
s are saved in a separate layer, the GLS layer. If an application object, for example, a
form, is modified in the GLS layer, the modifications are saved in the GLS layer only and the
modified version of the form is used.

HFX

HFX is an application object

patch layer reserved by Microsoft for future patching or other
updates. For more information, see
Application Object Patch Layers
.

SL1,
SL2, or
SL3

A layer where the distrib
utor can implement vertical partner solutions. SL is an abbreviation for
SoLution.

BUS

When a business partner creates their own generic solution, their modifications are saved in the
Microsoft Dynamics Axapta 2009

Page
35


BUS layer and the top level application objects are used.

VAR

Value Added Resellers (VAR) can make modifications or new developments to the VAR layer as
specified by the customers or as a strategy of creating an industry specific solution. Such
modifications are saved in the VAR layer.

CUS

The supervisor or admini
strator of an end
-
user installation might want to make modifications
that are generic to the company. Such modifications are saved in the CUS (CUStomer) layer.

USR

End users might want to make their own modifications, such as in their reports. These
modifications are saved in the USR layer.

Each layer is saved in a separate file that is named Ax<
layer
>.aod, for example, Axsys.aod for the SYS layer,
Axsl1.aod for th
e SL1 layer, and so on. The .aod extension is an acronym for Application Object Data.

In addition to the 10 layers, most layers also have a patch layer. For more information, see
Application Object
Patch Layers
.

2.3.1
How to: Set the Application Object Layer

The current layer is set when Microsoft Dynamics AX is installed.

To change the layer:

1.

Open the Configuration Utility (
Start

>
Control Panel

>
Administrative Tools

>
Microsoft
Dynamics AX Configuration Utility
).

2.

Select the
Developer

tab.

3.

Select a layer in the
Application Object Layer to open

list, and then click
OK
.

2.3.2
Application Object Patch Layers

I
n addition to the 10 application object layers in Microsoft Dynamics AX, there are also patch layers. The
patch layers are called SYP, GLP, BUP, VAP, CUP, and USP. This topic describes the patch layers and why you
should use them.

The patch layers are des
igned to make it easy to incorporate updates in your application. The basic idea is
that when a minor update or correction is made, it is distributed in a patch file, for example, Axsyp.aod.
When a patch file is present, the modified objects in the patch f
ile take precedence over the regular
application objects and are automatically used. The following illustration shows the application object layers
and the patch layers.

Microsoft Dynamics Axapta 2009

Page
36



The patch files use the same application object number series that the regular file
s use.

Using patch layers allows you to easily create and distribute an update, for example, by using the Internet,
without interfering with the existing application. When you subsequently incorporate the update in the
regular layer file, you can delete t
he patch file that is named Ax??p.aod and the index file Axapd.aoi.

2.3.3
Benefits of Layers

The fact that each layer is saved in a dedicated file means that it is easy to locate the file to backup. It also
means that you can easily remove undesired modifications by deleting the layer file.

Note