Sie sind auf Seite 1von 26

Chapter 1: Architecture

CHAPTER 1: ARCHITECTURE
Objectives
The objectives are:

• Describe the basic features of Microsoft Dynamics® AX 2012.


• Review basic form navigation.
• Review the architecture of Microsoft Dynamics AX 2012.
• Describe the options for making development changes in Microsoft
Dynamics AX 2012.
• Describe the theory of Model Driven Architecture in Microsoft
Dynamics AX 2012.
• Review licensing and configuration.

Introduction
Microsoft Dynamics AX 2012 is a customizable, multiple-language, and
multiple-currency Enterprise Resource Planning (ERP) solution. Microsoft
Dynamics AX excels in:

• Manufacturing.
• E-business.
• Wholesale.
• Services industries.

Microsoft Dynamics AX is a completely integrated solution and is web-enabled


and supports Microsoft® SQL Server®. With customizable source code, the
solution can be modified however and whenever it is necessary.

1-1
Development I in Microsoft Dynamics® AX 2012

Features of Microsoft Dynamics AX


Microsoft Dynamics AX is a unique and powerful solution that contains
functional and development environment features, which include the following:

• Functional features
o Single database architecture is used for all companies in the
organization.
o Highly integrated design between functional areas such as
resource planning, sales, and manufacturing.
o Dimension-based system for all modules.
o Advanced features such as Forecasting and Master Planning are
available.
o Multi-currency and Multi-language capabilities.

• Development environment features


o Microsoft Dynamics AX MorphX is an integrated development
environment (IDE) for developing in Microsoft Dynamics AX.
o Visual Studio is an alternative development environment for
web, report and managed code development.
o The Application Object Tree (AOT) provides a uniform and
compact viewing repository.
o Drag-and-drop functionality is supported for many programming
tasks.
o Projects help organize and track customized applications in
Microsoft Dynamics AX.

Client Workspace
The client workspace is the standard rich client interface that an end-user uses.
The workspace consists of various components:

Navigation Pane

The Navigation pane is the menu on the left side of the screen that shows all of
the modules the current user has access to.

Content Pane

The content pane displays role centers, list pages and area pages.

• Role centers display specific data, reports, alerts, and common tasks
associated with a user's role in the organization. The role center is
displayed when an end-user opens the application or goes to Home in
the Navigation pane.
• List pages display lists of data. They are optimized to view and
search through a list of records and act on information.

1-2
Chapter 1: Architecture

• Area pages display all menu items relevant to the module selected in
the Navigation pane. They are grouped logically to make it easier for
end-users to find what they need.

FIGURE 1.1 WORKSPACE

Customers List Page


In the Navigation pane, click Accounts Receivable > Common > Customers >
All customers. This brings up a list of all customers in the system.

In the center of the form is a grid that displays a list of customers. At the top of
the screen is the Action Pane that contains buttons to open other forms and take
actions related to the selected customer. On the right are FactBoxes that show
data related to the selected customer.

To create a new customer, click New > Customer in the Action Pane. A new
form opens where you can enter data for the new customer. Fields with a red
wavy line are mandatory.

1-3
Development I in Microsoft Dynamics® AX 2012

In the grid on the list of customers, click the field header of the Customer
account field. Doing this sorts the data by customer account number order.

FIGURE 1.2 CUSTOMER LIST PAGE

Architecture
Microsoft Dynamics AX has a three-tier architecture.

Three-Tier Architecture
Three-tier architecture is defined as having a separate database, server and client
where:

• The database stores the data.


• The server runs the application business logic.
• The client application allows users to connect to the server to access
business logic and use the data in the database.

In Microsoft Dynamics AX the three tiers include the following:

• A SQL Server Database that houses the data entered into, and used
by, the Microsoft Dynamics AX application. It also houses the model
store that contains the application elements. (Application elements
are explained in the following lesson)
• An Application Object Server (AOS) is a service that runs most of
the business logic. This runs continuously on a central server.

1-4
Chapter 1: Architecture

• The Client application is the user interface through which an end-


user accesses Microsoft Dynamics AX. There are various clients
available including the Microsoft Dynamics AX rich client and
Enterprise Portal.

FIGURE 1.3 THREE TIER ARCHITECTURE

Extended Architecture
Several other components of the Microsoft technology stack are used in a typical
deployment.

Reports are delivered by SQL Reporting Services (SSRS). SSRS is a component


included in SQL Server.

Business Intelligence (BI) components such as Key Performance Indicators use


Online Analytical Processing (OLAP) cubes which are delivered by SQL
Analysis Services (SSAS). SSAS is a component included in SQL Server.

The Enterprise Portal and Role Pages are hosted in SharePoint. There are two
versions of SharePoint that can be used. Window SharePoint Foundation 2010 is
a free download. Microsoft SharePoint Server 2010 is a product that can be
purchased to provide extended collaboration and content management tools.

Integration to other applications or to third party organizations might require


integration solutions such as web services.

1-5
Development I in Microsoft Dynamics® AX 2012

The following image describes a typical system architecture that includes other
components of the Microsoft technology stack.

FIGURE 1.4 EXTENDED ARCHITECTURE

SQL Server Databases


Microsoft Dynamics AX Database

The Microsoft Dynamics AX database is an Online Transactional Processing


(OLTP) database that stores all the business data in SQL tables.

This database also stores all of the metadata and application code in the Model
Store.

Business Intelligence (BI) Databases

Some BI components of Microsoft Dynamics AX also require you to use SSRS


and SSAS. The SSAS database is replicated from the OLTP database in a
database format that is optimized for fast reporting and analysis.

1-6
Chapter 1: Architecture

Application Object Server


The Application Object Server (AOS) is the Microsoft Dynamics AX
application server. The AOS is where most of the business logic is executed.

The AOS performs many tasks. Some of the most important tasks include:

• X++ runtime: It runs the X++ code which provides most of the
business logic in Microsoft Dynamics AX.
• Security: It enforces security to manage access to data and
functionality.
• Session management: It manages client sessions.
• Web services: It is a web service endpoint.

Multiple AOS's can be installed to spread the processing load over multiple
servers. This improves performance in larger implementations.

Clients
Microsoft Dynamics AX Rich Client is the primary client to access Microsoft
Dynamics AX functionality. Most forms displayed in the rich client are designed
by using the MorphX development environment. Role center pages are
SharePoint pages that are displayed within a rich client form. SQL reports are
called from the rich client by using the report viewer control.

Enterprise Portal pages are displayed through a web browser. A subset of


functionality and reports are available on the portal.

Microsoft Office® can be used as a client to access the Microsoft Dynamics AX


application and data. Office add-ins are available out-of-the-box for Microsoft
Excel and Microsoft Word.

Other Applications can be used as a client to the Microsoft Dynamics AX


application. Examples include mobile applications, specialized applications
written in .net and legacy applications. Applications can be integrated using
methods such as web services or the .net business connector.

The .NET Business Connector is a client that has no user interface. It is


designed for other applications to access the Microsoft Dynamics AX business
logic. End-users can use another application as the user interface that interacts
with the AOS through the .net Business Connector.

Developers can access the developer tools through the MorphX IDE in the
Microsoft Dynamics AX client or through Visual Studio Tools in Visual Studio.

1-7
Development I in Microsoft Dynamics® AX 2012

Other Components
Internet Information Server (IIS)

IIS is a web server that delivers content such as web pages.

Enterprise Portal and SharePoint

IIS is required to host the Enterprise Portal framework within SharePoint. Role
Centers require the Enterprise Portal regardless of whether they are viewed
through the web browser or the Microsoft Dynamics AX Windows Client.

Help Server

Microsoft Dynamics AX Help files are hosted through IIS. When a user accesses
Help from within the rich client, the AOS generates a call to the Help server to
display the Help pages.

Web Services

Web Services are hosted within IIS. The AOS is the web service endpoint that
provides the data that is served to other applications by IIS in a standardized
format.

Development Environments
The Microsoft Dynamics AX application is built of elements that are stored in
the model store in the SQL Service database. For example, the following element
types make up part of the application:

• Fields and Tables define data structure.


• Forms and Menus define how a user interacts with the application.
• Classes and Methods are code objects that define business logic.

The Application Object Tree (AOT) provides a visual representation of the


elements that comprise the application.

Object-oriented design and Inheritance are key concepts that form the basis of
the application.

1-8
Chapter 1: Architecture

Model elements can be modified or added using a development environment. The


development environments that can be used with Microsoft Dynamics AX 2012
include:

• Microsoft Visual Studio.


• Microsoft Dynamics AX Integrated Development Environment
(IDE). This is also referred to as the MorphX IDE and is accessed
through the developer workspace in the Microsoft Dynamics AX
client.

A white paper titled "Selecting the Best Development Technology for your
Application Development Scenario AX2012" is available for download on
MSDN.

Application Object Tree


A full definition of all the element types in Application Object Tree (AOT) can
be found in the development training material and developer Help files. Some of
the root element types include:

• Data Dictionary contains objects that define basic data structure.


o Tables contain a group of associated fields. For example the
CustTable contains fields relevant to customers. Fields on a table
contain individual pieces of data. For example, AccountNum
contains the customer account number. Fields on a table inherit
properties from extended data types.
o Extended data types define a data type and extended properties.
There are various basic data types such as a string, integer, date,
time and enum. For example, AccountNum is a string extended
with properties including a length of 20 characters, left justified
and is mandatory.
o Base Enums are enumerated text data types. These are
predefined text values that are referenced by an integer value in
the database. These are presented to the user as a fixed list of
options. For example, Blocked is an enum that gives the user
only two options (yes or no) as to whether a customer account is
on hold.

• Classes contain code that is used in the application.


• Forms define the layout of all of the forms. Forms are used to view
data in the Microsoft Dynamics AX client.

1-9
Development I in Microsoft Dynamics® AX 2012

• Visual Studio Projects display any development projects created in


Visual Studio.
• Menus define forms and reports that appear in the menu in the
Microsoft Dynamics AX rich client.

FIGURE 1.5 AOT DISPLAYED IN THE DEVELOPER WORKSPACE

Labels
Labels are used to provide the language text that end-users see when using the
application. All text presented in the client displays the translation of a label
code. The label codes usually are reused wherever the exact same text is used
with the same meaning. This makes it easier to manage multiple languages and to
adapt to company specific language.

As an example:

• The label code @SYS78211 is translated as "Direct delivery" in the


English-US label file. This label code is used in various places
throughout the application. It is used on field names and menu items
displayed on forms such as the Sales Order Header form.
• All label codes are already translated into all other languages in
which Microsoft Dynamics AX is available. This label code is
translated as "Entrega directa" in the Spanish label file. If an end-
user opens the application in Spanish, they will see the Spanish
translation wherever this label code is used.
• Developers can create new label files to translate label codes into
other languages or customer specific terminology. Tools, including
the label editor and label wizard, are available within the MorphX
development environment to add or change label files.

1-10
Chapter 1: Architecture

MorphX IDE
The MorphX IDE is accessed through the Developer Workspace which provides
access to the AOT and other developer tools. It is used to make changes and add
to the application. This is the most commonly used development environment.

Common operations such as building or modifying tables, forms and menus can
be performed by using drag-and-drop techniques with little or no coding. X++ is
the programming language that is used in the MorphX IDE to write more
advanced business logic.

You can access the MorphX IDE from the Microsoft Dynamics AX client. Click
the Windows menu in the command bar and select New Developer Workspace.
Alternatively you can use the shortcut keys Ctrl+Shift+W.

X++ Tools
X++ is the object-oriented programming language that is used in the MorphX
development environment. X++ has C#-like syntax, and incorporates SQL data
manipulation statements.

A full list of developer tools in the MorphX development environment can be


found in the developer help documentation. Some of the tools available include:

• The X++ Code Editor is a text editor used to write X++ code. It
supports color-coding and allows to look up and select various
objects such as method names and enumeration values as you type.
• The Debugger is an application used by developers to step through
X++ code to help resolve code errors.
• The Reverse Engineering tool enables you to visualize data and
classes in Microsoft Dynamics AX by creating UML data models,
UML object models, and ERX ER data models.
• The Table browser displays data from all fields in a selected table.
The table browser can be used to run SQL statements.

1-11
Development I in Microsoft Dynamics® AX 2012

NOTE: Extreme care must be taken when updating records in the table browser.
It should be regarded as a development and testing tool. It is always better
practice to update data from the Microsoft Dynamics AX client.

FIGURE 1.6 X++ CODE EDITOR

Visual Studio
The Visual Studio development environment is integrated through Visual Studio
Tools for Microsoft Dynamics AX (Visual Studio Tools) and it supports
managed code.

Close integration between MorphX and Visual Studio means developers can take
advantage of the benefits of each development tool and work in the environment
that best suits their development scenario.

Some development scenarios must take place in Visual Studio. This includes
creating and customizing SSRS reports, most Enterprise Portal web development
and any managed code development.

1-12
Chapter 1: Architecture

The Application Explorer is available within Visual Studio. This gives


developers the ability to browse AX metadata. The Application Explorer displays
information that is similar to the AOT in the MorphX IDE. Visual Studio projects
are displayed in the AOT and are stored in the Microsoft Dynamics AX model
store in SQL server.

FIGURE 1.7 APPLICATION EXPLORER IN VISUAL STUDIO

Development Projects
While developing in Microsoft Dynamics AX, you can group all your
modifications in to a development project. To create a new development project,
click the project icon in the development workspace, or press Ctrl-Shift-P.
Private projects are visible to the user creating them and shared project are
visible to everyone.

To create a new shared project:

• Right-click the Shared node and select New > Project.


• Give the project a descriptive name and then double-click it to open
it. Now any elements from the AOT can be dragged in to this project.
This creates a reference to the element. Modifying elements in the
project is the same as modifying them directly in the AOT.

Model Driven Architecture


Microsoft Dynamics AX is designed with a unique layer and model structure that
separates and controls the updates and modifications made in the application.
This structure provides a powerful and flexible architecture for developing
business logic.

1-13
Development I in Microsoft Dynamics® AX 2012

The key benefit of the layer and model structure is that it lets developers change
and extend the functionality in Microsoft Dynamics AX while maintaining
upgradability to new versions.

Layers
Application object layers hold all elements that are displayed in the AOT. There
are eight application object layers available. Each of these layers also has a patch
layer making a total of sixteen layers.

Layers are a hierarchy of levels in the application you can use to make
modifications and additions without interfering with the application elements in
the next lower level. When you make an element modification on one level, the
modification overshadows the element on a lower level. When the application is
compiled, only the top-level version of an application element is used.

There are three layers available only to Microsoft to deliver the base application.
(The xxP layer indicates the patch layer for each application object layer).

Layer Description
SYS, SYP System layer: The standard application is developed in this
lowest layer. This includes the core application and the
localization for most countries.
GLS, GLP Globalization layer: Includes features developed for some
countries that were not yet moved into the SYS layer.
FPK, FPP Feature Pack layer: Includes industry feature packs that are
controlled by Microsoft.

There are three layers available to partners and ISVs.

Layer Description
SLN, SLP Solution layer: Includes Microsoft endorsed industry solutions.
ISV, ISP Independent Software Vendor layer: Includes generic or
vertical solutions developed by ISV's.
VAR, Value Added Reseller layer: Includes multi-customer solutions
VAP developed by VAR's.

1-14
Chapter 1: Architecture

There are two layers available to both partners and customers who have a license
to access the AX source code.

Layer Description
CUS, CUP Customer layer: Includes customer specific functionality.
USR, USP User layer: Includes installation specific functionality and
customizations.

FIGURE 1.8 APPLICATION LAYERS

Benefits of Layers: Source Code Protection


The elements in the standard implementation (SYS, GLS, FPK layers) can only
be changed or deleted by the Microsoft Dynamics AX Development team.

The layers help protect the original source code and keep it separate from
modifications.

Similarly, ISV solution code is separated in a model within the ISV layer. Any
customer specific changes to the ISV solution would be in a higher layer.

1-15
Development I in Microsoft Dynamics® AX 2012

Benefits of Layers: Faster and Easier Upgrades


Upgrades and service packs contain changes in the lower layers where the base
code resides. This means that any changes by partners or customers are
maintained throughout the upgrade. Powerful compare and merge tools are
available to guide developers through the upgrade. These tools highlight
elements that are modified in higher layers and therefore might require some
action to merge the changes.

As an example:

• The item number is an extended data type that exists in the SYS
layer. This field is a string which is 20 characters in length.
• If a company that uses Microsoft Dynamics AX requires 30
characters for their item numbers, the field length would be changed
to 30 characters and the change saved in the CUS layer. The item
number data type now exists in both the SYS layer and the CUS
layer. The CUS layer is a higher layer so when the application is
compiled, the 30 character length is used.
• If in a future version, Microsoft extends the length of the item field
to 40 characters, the upgrade tool would highlight that there is a
change in the SYS layer to 40 characters and there is an existing
change in the CUS layer to 30 characters. The developer would then
have the option to keep the CUS layer change or delete the CUS
layer and revert to the new field length in the SYS layer of the new
release.

Models
A model is a logical grouping of elements within a layer. Models help in
situations where multiple ISV solutions or projects must operate together. This
architecture allows many solutions to co-exist within each layer.

An element can exist in exactly one model in a layer. The same element can exist
in a customized version in a model in a higher layer. New models are easy to
create in the MorphX IDE and are applied when modifying or adding objects in
the AOT. Models can be exported, installed, or uninstalled from the model store.
Models are identified by a name and a publisher, and have a set of properties that
can be changed, including a version number.

Following is an example:

• A company has two lines of business. They manufacture and sell


medical products. They also manufacture, sell and service
specialized equipment to produce medical products.
• Solution A is an advanced vertical solution for the production of
food and drug products. Among other things, this solution adds a
new field to the item table to store the government approval number.
This is stored in the ISV layer and in the model MEDICAL.

1-16
Chapter 1: Architecture

• Solution B is an advanced vertical solution for managing the ongoing


service of equipment which is sold to customers. Among other
things, this solution adds a new field to the item table for the default
service period. This is stored in the ISV layer and in the model
SERVICE.
• You can use models to view the modifications to the item table made
by all ISV solutions and easily see where each change originated.

Managing Models
Models can be created in the development workspace by clicking on Tools >
Model management > Create model. Then you can enter the model name, your
company, which layer the model is in, the version number, a full description, and
a shorter description. The combination of name and publisher make a unique
model.

FIGURE 1.9 CREATING A NEW MODEL

To change the current model, click the current model in the status bar.

1-17
Development I in Microsoft Dynamics® AX 2012

Lab 1.1 - Create a New Model and Development Project


In this lab you will create a model and a development project to keep your
modifications organized. During the remainder of the course, any elements you
modify or create should be added to this project.

Scenario

Isaac, the Systems Developer, needs to make a number of modifications to the


system. He wants to be able to group all the elements he creates and modifies
together in one place, and also make it easy to move the modifications to test and
production systems later.

Challenge Yourself!
Create a model called Dev1 and a development project called Dev1Training

Step by Step

1. Click Tools > Model Management > Create Model.


2. Enter Dev1 in the model name, your name in the publisher and
Dynamics AX Development 1 training labs in the description.
3. Click OK.
4. Click Close on the infolog dialog.
5. Press Ctrl-Shift-P to open the development projects window.
6. Right-click the Shared node and select New > Project.
7. Rename the project to Dev1Training.

1-18
Chapter 1: Architecture

Licensing and Configuration


The basic security architecture in Microsoft Dynamics AX includes license codes
and configuration keys.

License Codes
License codes control the modules that can be used within Microsoft Dynamics
AX. If a license code for a module is not purchased, none of that functionality is
available.

Configuration Keys
Configuration keys in Microsoft Dynamics AX control the functionality and
features in the system. These keys ensure the Microsoft Dynamics AX solution is
not cluttered with functionality companies do not use. Configuration keys have
descriptions to describe the functionality affected by enabling or disabling them.
Each configuration key is attached to a license code, so if the license is not
purchased, the configuration key is unavailable.

FIGURE 1.10 ACCESSING CONFIGURATION KEYS

Each configuration key controls access to a specific feature, and once it is


enabled or disabled, the feature is automatically added or removed in the user
interface. The underlying tables attached to that configuration key still exist in
the database, but are set to be temporary tables, which do not store data.

1-19
Development I in Microsoft Dynamics® AX 2012

Summary
This course provided a high-level introduction to the Microsoft Dynamics AX
architecture.

The course introduced important terms related to Microsoft Dynamics AX


Development, and it also discussed the user interface and the different ways data
can be presented in forms and reports.

This course also discussed the basic security architecture that includes License
codes and configuration keys.

1-20
Chapter 1: Architecture

Test Your Knowledge


Test your knowledge with the following questions.

1. Microsoft Dynamics AX 2012 has a three-tier architecture. What are the


three tiers and what is the purpose of each tier?

2. What client applications can be used to access Microsoft Dynamics AX


2012? (Select all that apply)
( ) Microsoft Dynamics AX Rich Client
( ) Internet Information Server
( ) Application Object Server
( ) Enterprise Portal

3. Match the following modifications to the layer which they are, or should be,
developed in.

_____ 1. The core customer table a. CUS


_____ 2. A bank file import format developed by a partner b. VAR
that can be used for several of their customers. c. SYS
_____ 3. A new field on the item table required for a vertical d. ISV
solution developed by an ISV.
_____ 4. A new label code specified on a field to better
reflect a particular customer's terminology.

4. Which of these statements best describes models in Microsoft Dynamics


AX?
( ) A view of the metadata within the MorphX IDE.
( ) A logical grouping of elements within a layer.
( ) A visual representation of objects.
( ) A piece of X++ code.

1-21
Development I in Microsoft Dynamics® AX 2012

5. What is displayed in the Application Object Tree? (Select all that apply)
( ) Tables
( ) Forms
( ) Menus
( ) Visual Studio Projects

6. Which tools can developers use to write Microsoft Dynamics AX business


logic? (Select all that apply)
( ) Microsoft Office
( ) Visual Studio
( ) MorphX IDE
( ) SQL Server

1-22
Chapter 1: Architecture

Quick Interaction: Lessons Learned


Take a moment and write down three key points you have learned from this
chapter

1.

2.

3.

1-23
Development I in Microsoft Dynamics® AX 2012

Solutions
Test Your Knowledge
1. Microsoft Dynamics AX 2012 has a three-tier architecture. What are the
three tiers and what is the purpose of each tier?

MODEL ANSWER:

SQL Server Database - houses the data entered into, and used by, the
Microsoft Dynamics AX application. It also houses the model store that
contains the application elements. (Application elements are explained in the
following lesson)

Application Object Server - a service that runs most of the business logic.
This runs continuously on a central server.

Client application - the user interface through which an end-user accesses


Microsoft Dynamics AX. There are various clients available including the
Microsoft Dynamics AX rich client and Enterprise Portal.

2. What client applications can be used to access Microsoft Dynamics AX


2012? (Select all that apply)
(√) Microsoft Dynamics AX Rich Client
( ) Internet Information Server
( ) Application Object Server
(√) Enterprise Portal

3. Match the following modifications to the layer which they are, or should be,
developed in.

c 1. The core customer table a. CUS


b 2. A bank file import format developed by a partner that b. VAR
can be used for several of their customers. c. SYS
d 3. A new field on the item table required for a vertical d. ISV
solution developed by an ISV.
a 4. A new label code specified on a field to better reflect
a particular customer's terminology.

4. Which of these statements best describes models in Microsoft Dynamics


AX?
( ) A view of the metadata within the MorphX IDE.
(•) A logical grouping of elements within a layer.
( ) A visual representation of objects.
( ) A piece of X++ code.

1-24
Chapter 1: Architecture

5. What is displayed in the Application Object Tree? (Select all that apply)
(√) Tables
(√) Forms
(√) Menus
(√) Visual Studio Projects

6. Which tools can developers use to write Microsoft Dynamics AX business


logic? (Select all that apply)
( ) Microsoft Office
(√) Visual Studio
(√) MorphX IDE
( ) SQL Server

1-25
Development I in Microsoft Dynamics® AX 2012

1-26