Professional Documents
Culture Documents
Dynamicsax2012developmentoverview 140530195324 Phpapp01
Dynamicsax2012developmentoverview 140530195324 Phpapp01
2012 Development
Overview
Ali Raza Zaidi
MVP (Dynamics Ax)
Advisory Software
Engineer At Systems
Limited.
Agenda
Dynamics AX 2012 Features and
History Modules
Dynamics AX Development Pattern
Dynamics Ax 2012 Navigation and
layout overview.
Dynamics Ax architecture
Overview of X++
Short Introduction to AIF
Q&A
2
What is ERP.
Enterprise resource planning(ERP) is a
business management softwareusually a
suite of integrated applicationsthat a
company can use to collect, store, manage
and interpret data from many business
activities, including:
Product planning, cost and development
Manufacturing or service delivery
Marketing and sales
Inventory management
Shipping and payment
Dynamics AX 2012
Completely integrated ERP solution
One business logic, one database
Easily recognize the dependencies of
business activities
Rich functionality
State-of-the-art technology
Layer technology
Integrated Development environment
Three-tier architecture
Dynamics AX
Dynamics AX
Dynamics AX
Dynamics AX
Accounting
Dynamics AX
Dynamics AX
Dynamics AX
Dynamics AX
Dynamics AX
Dynamics AX
Dynamics AX
Financial Management
Requisitions and Purchase Orders
Expense Management
Project Management and Project
Supply Chain Management
Inventory Management and Warehousing
Sales Orders
Service Management
Production and Manufacturing
Fixed Assets
CRM and Sales and Marketing
Development Patterns In
Dynamics Ax 2012
Customization
Alteration
Extension
Enhancement
Integration
SSIS
BizTalk
Customization
Customization is the development pattern in which you create
new functionality by altering, extending, or enhancing the
functionality in the shipped product.
Integration
Integration is the development
pattern that involves enabling existing
applications (not written exclusively
for Microsoft Dynamics AX) to interact
and work with Microsoft Dynamics AX
across process boundaries.
External application
module development
Navigation
6/7/15
13
Client Workspace
Role Center
Role center is user page, appear on
opening at Dynamics Ax. The role
center is depending on rights and role
of user. Role center provide
dashboards, which helps to user to
monitor their roles. This information
include transaction data, alerts, links
and common tasks that are associated
with users role.
6/7/15
16
Footer Text
6/7/15
17
Footer Text
6/7/15
18
Area Page
Area page is the main page of Every
Module.
This area page have link to, List page,
Journal, Reports, Setup table list, Inquiries
and Periodic page.
By Default 20 area page exists for dynamics
Ax.
Each Area page focus on one complete
module or area, for example Account
receivable, Account payable, cost
accounting and Administration.
Footer Text
6/7/15
19
Footer Text
6/7/15
20
Footer Text
6/7/15
21
Footer Text
6/7/15
22
Detail From:
Detail forms are primary way to create
or update entities in Dynamics Ax like
customer Vendor, worker and
products. These detail forms can be
open by click on list page. By default
these pages are open in read only
mode. You have to click edit button to
open in detail page.
Footer Text
6/7/15
23
Footer Text
6/7/15
24
6/7/15
25
Line View
This shows a few header level fields
which are required for transaction.
This default view and items are added
here.
Footer Text
6/7/15
26
Header View:
This contains all most all fields at
header view. Most of fields have
default values and did not modify
here.
Footer Text
6/7/15
27
Periodic:
All those page which will periodically
access by user
Footer Text
6/7/15
28
Journal:
These pages link to all related which
have some functional or finance
related journal
Footer Text
6/7/15
29
Dynamics Ax Architecture
and Layers
Three-Tier Architecture
The following image describes a typical system architecture that includes other
components of the Microsoft technology stack:
Application tier
Active Directory domain controller
Application Object Server
Enterprise Portal
Enterprise Search
Reporting
Analytics
Services and Application Integration
Framework (AIF)
Help server
Data tier
Development
Environments
Morphx IDE
written here
Visual Studio.
Any Manage Code will be written here
Report Customization and Development.
Remote Debugging Tools.
Application Explorer (Read Only ).
Layer
Description
USR
CUS
VAR
ISV
SLN
FPK
The FPK layer is an application object patch layer reserved by Microsoft for
future patching or other updates. For more information, seePatch Layers.
GLS
SYS
The standard application is implemented at the lowest level, the SYS layer.
The application objects in the standard application can never be deleted
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.
An element can exist in exactly one
model in a layer.
New models are easy to create in the
MorphX IDE and are applied when
modifying or adding objects in the
DATA DICTIONARY
Topics
Application Object Tree
Labels
Table Structure and Components
Views
Maps
Base Enums
Extended Data Types
Table Collections:
Projects
Label Files
system which systematizes all the labels (for buttons, forms,
dialog boxes, and more) for a specific language in one file; a
label file
A label is the text that appears in the user interface.
Create New Label File: Tools > Development Tools > Label >
Label File Wizard.
Relations:
Relations are a method that helps
secure business rules to enforce
existing properties between field
values existing in different tables. This
is known as referential integrity.
DATA
DICTIONARY(Contd.)
DATA
DICTIONARY(Contd.)
View
A view is an X++ SQLselectstatement that is given a name that is reusable in
other X++ SQL statements. Theselectstatement of the view can reference one
table, or it can join tables. Also, a view can reference other views, or a mix of
views and tables. A view can also reference maps.
Developers are encouraged to consider using an AOTqueryelement as the
source of data for their view.
Views are specified atAOT>Data Dictionary>Views.
DATA
Base Enums : Base enums are a list of literals. They can be
DICTIONARY(Contd.)
used
throughout the development environment in MorphX.
Table Types
Regular Table.
In memory Tables.
Less then 128k remain in memory
ISAM Index sequential Access Method
Does not map on any physical table.
Initiate only when first insert occur, and
TempDB
Stored Sql Servers TempDB.
TempDb
Tables Created in SQL Server TempDb.
Can bejoined.
Can be either per company or global.
Can haveforeign keycolumns.
Can have methods, but cannot
override.
AOT Queries can be used TempDb as
source.
Transaction support.
TempDb limitations
Cannot use theTable browser form.
Can not be part of Table collection.
Projects:
Projects organize new or customized application objects.
Think of a Project as a reference folder for related objects.
Advantage of Projects is the ability to save a project's
contents and state separately for each user by using Private
Projects.
Macros :
With the macro capabilities in X++, you can define and use
constants and perform conditional compilation. Macros are
unstructured because they are not defined in the X++ syntax.
Macros are handled before the source code is compiled. You can
add macros anywhere you write source code: in methods and in
class declarations.
The jobs node on the application object tree contains small X ++ programs that are
executed as batch jobs.
They are useful when developing and testing new functionality for Microsoft Dynamics
AX 2012.
Queries ask questions about
data stored in a database.
The information selected by a
query can be used as the
basis for a form, auto report.
X++ OVERVIEW
Code Editor
Jobs
Compiler
The Debugger
Compare
Development Tools(Contd.)
Reverse Engineering
Simplify collection
Extract relationships
Integrate and view collections
in Microsoft Office Visio as UML
diagrams
Naming conventions
Naming conventions contribute to consistency and to
making
the application easier to understand.
{business area name} + {business area description} +
{action performed (for classes) or type of contents (for
tables)}
Examples:
CustJournalPrintOutInvoice
PriceDiscAdmDelete
PriceDiscAdmSearch
PriceDiscAdmName
PriceDiscAdmTrans
Comments
Single line //
Block comments /* */
To do comments TODO. To do comments appear in the compilers
Tasks tab page.
/// <summary>
/// This is an XML comment with tags to distinguish
sections.
/// </summary>
Declaration
Keyword
Description/Example
String
str
any string
Integer
int
2356
Real
Real
3.14
Date
date
24\11\2010
Enum
Must be declared
as a Base Enum
first
Boolean
boolean
True/False
Time
timeOfDay
15:23:08
utcDateTime
utcDateTime
9/28/2008
07:11:02 am
Guid
guid
Int64
Int64
Variable Declaration:
dataType
variableIdentifier;
Array Declaration:
real
realUnlimtedArray[];
real
realLimitedArray[10];
Term
Description
Becomes
equal to
+=
++
-=
--
while (condition)
{
//statement;
}
Communication Tools:
Communicating with the end-user
Main types of communication are the following:
Forms and reports which are used for input and output
of larger amounts of data
Print commands, infologs and dialog boxes which are
generally used for specific data input and output
Method Access
There are three modifiers available:
Public allows the method to be called
from any code in the application.
Protected allows the method to be
called only by methods in the same
class or subclasses of the class in
which the method is defined.
Private allows the method to be
called only by methods in the same
class in which the method is defined.
Static methods are methods that are attached to a class, but do not need
that class to be instantiated to execute that method. They are not within
the scope of the class, so any class variables are not available in a static
method.
static void myStaticMethod() { }
myClass::myStaticMethod()
Main Method
It is used by the system when the class is run directly from a
menu item and it takes a parameter of type args.
static void main(Args args){}Args
is a class that is used to pass parameters between objects, for
instance, various parameters can beset on the properties on a
menu item. When the menu item calls a class, the args class
containing those property values is passed to the main
method using the args parameter.
Display Methods
Display methods are used on forms and in reports. Display
methods return a value.
display itemName itemName() {
inventTable
inventTable
;
select name from inventTable
where inventTable.itemId == this.itemId;
return inventTable.name;
}
// To Loop Records
while select AccountNum, Name, Address
from CustTable
{
print CustTable.AccountNum+ ": " + CustTable.Name + ": " +
CustTable.Address;
}
pause;
Sort
You can sort data retrieved from the database in many ways.
This includes:
Inner join
CustTable custTable;
DirPartyTable partyTable;
while select custTable
join partyTable
where custTable.party==
partyTable.RecId
{
info (custTable.AccountNum + " "
+partyTable.Name);
}
Exist
while select * from custTable
order by AccountNum
notExists
CustTable custTable;
CustBankAccount custBankaccount;
;
while select AccountNum from custTable order by
AccountNum
notexists join * from custBankaccount where
(custTable.AccountNum==custBankaccount.AccountNum
&& custTable.BankAccount == custBankaccount.AccountID
)
{
info( custTable.AccountNum);
}
outer
while select AccountNum from
custTable order by AccountNum
outer join * from salesTable
where salesTable.CustAccount
== custTable.AccountNum
Count
CustTable xCT;
int64 iCountRows; ;
Select COUNT(RecID) from xCT;
iCountRows = xCT.RecID;
SalesTable SalesTable;
;
update_recordset SalesTable
setting salesName = "Update RecordSet",
DeliveryStreet = "New Address"
where SalesTable.CustAccount == "1102 ;
info("Updated Successfully via RecordSet");
QueryRun()
EXCEPTION HANDLING
Exception:
When code is running, errors can occur due to user input,
setup, data, code, or installation problems.
Users need a clear indication of when errors occur so they
can resolve the problem or report it to an administrator or
systems developer, who can investigate what went wrong.
EXCEPTION HANDLING
Exception Example:
static void Exception3(Args _args)
{
CustTable custTable;
;
try
{
custTable.AccountNum = '54299';
custTable.CustGroup = '50';
custTable.Address = 'Lahore Pakistan';
if(!custTable.validateWrite())
throw error("1. Record Failed during Validation.");
custTable.insert();
info("2. Record saved in database successfully, while passing validation");
}
catch(Exception::Error)
{
error("3. There was an error, while inserting the record.");
}
}
Types of services
Query service
Custom Service
Document Service.
Query Service
Publishes service operations that
allow execution of existing (static) or
ad hoc queries from service clients
and returns results in the form of
generic .NET datasets.
Custom Service
X++ method can be expose as service
Custom service artifacts
Service implementation class A class that
implements the business logic and exposes it
through X++ methods.
Service contract Service-related metadata (no
code). The most important service metadata
consists of the service operations that are
published to external service applications, and a
reference to the X++ service implementation class
that implements these service operations.
One or more data contracts X++ classes that
represent the complex parameter types used for
service operations. Data contracts are not needed
for primitive data types.
Document services
Document service
artifacts
http://technet.microsoft.com/enus/library/gg852966.aspx
Book, Inside Dynamics Ax 2012