Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
By
Contents
Objective. Prerequisite for Audience Dynamics Ax Microsoft Dynamics AX 2009 Architecture Data Dictionary User Interfaces Report Adjustments X++ Overview X++ Control Statements Classes and Objects Accessing the database Exception Handling Conclusion
Objective
Dynamics Ax
Microsoft Dynamics AX 2009 is: customizable multiple-language multiple-currency Enterprise Resource Planning (ERP) solution.
Developer(s)
Stable release Development status Operating system Platform Available in
Microsoft Corporation
5.0.593.0 (2009) / June 2, 2008; 2 years ago Active W indows Server 2003/2008 (AOS), Microsoft W indows (Clients) x86
Arabic, Chinese (Simplified), Czech, Danish, Dutch (Netherlands), English, Estonian, Finnish, Dutch (Belgium), French, German, Hungarian, Icelandic, Italian, Japanese, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Russian,Spanish, Swedish, Thai, Turkish
http://www.microsoft.com/dynamics/ax/default.mspx
Advantages of using Microsoft Dynamics AX 2009 Microsoft Dynamics AX 2009 excels in: Manufacturing E-business W holesale Services industries completely integrated solution. W eb-enabled supports Microsoft SQL Server and Oracle
3) IntelliMorph
IntelliMorph is the technology that controls the user interface in Microsoft Dynamics AX 2009. IntelliMorph controls the layout of the user interface and makes it easier to modify forms, reports, and menu.
4) MorphX
The MorphX Development Suite is the integrated development environment (IDE). An IDE integrates development functions such as designing, editing, compiling, and debugging within a common environment.
5) Inheritance
Think of inheritance as a child object receiving properties from a parent object.
6) X++
X++ is the object-oriented programming language that is used in the MorphX environment.
NAVIGATION
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 W izard.
DATA DICTIONARY
DATA DICTIONARY(Contd.)
Tables: Tables store data in the system. They are organized in fields. These are assigned to different data types, depending on the type of data they hold. Data is entered, edited, and deleted through forms. Tables are discussed in more detail later in the section. Creating a Table: 1. Create a table. 2. Create extended data types. 3. Add fields to the table. Drag relevant extended data types to the Fields node of the relevant table. 4. Create relations on extended data types. 5. Create indexes.
DATA DICTIONARY(Contd.)
Indexes : The indexes in the Microsoft Dynamics AX 2009 table definition are the physical indexes that exist on the tables in the database. There are two types of indexes: Unique Non-Unique 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 Types Primitive and Extended Microsoft Dynamics AX 2009 has built in primitive and extended data types associated with the information in the database. Primitive Data Types
Extended Data Types Extended Data types can inherit either from primitive types or other Extended Data Types, which enables properties to be inherited.
DATA DICTIONARY(Contd.)
Delete Actions: Microsoft Dynamics AX 2009 uses a category of methods called Delete Actions to govern how data is handled when a deletion event occurs in a parent tableRelations. Methods: Microsoft Dynamics AX 2009 uses methods within the table node to perform a variety of functions such as contact person and currency name lookup.
DATA DICTIONARY(Contd.)
DATA DICTIONARY(Contd.)
Base Enums : Base enums are a list of literals. They can be used throughout the development environment in MorphX.
Table Collections: Table collections do not contain any data. Virtual companies are built on table collections. They contain tables shared by more than one company. A table can be a part of more than one table collection. Perspectives : Perspectives organize tables, folders, fields, and roles, in subsets according to application modules in an intuitive way
USER INTERFACES
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.
Forms
Forms are the primary method of interaction between Microsoft Dynamics AX 2009 and a user. Elements that Compose a Form
Forms(Contd.)
Creating Forms:
Menus Items
To enable activation of application objects from the user interface. key properties: Name - The name of this menu item Label - The label appearing on the menu item ObjectType- The type of object this item points to Object - The object name that this item points to RunOn - The location (Client or Server) where the object will run Security Key - A key defined in the data dictionary that defines the security access for the menu item Menu items type Display Output Action
Menus Items(Contd.)
Creation Of Menu Item:
Menus Items(Contd.)
Navigation Pane and Area Pages/Menue
Menus Items(Contd.)
Adding Menue to MainMenu
Macros : Macros act as a container for defining variables used for frequent tasks. The purpose of macros is to make statements easy to reuse. A macro cannot be executed independently of a class.
REPORT ADJUSTMENTS
Design reports using the visual report Designer
REPORT ADJUSTMENTS(Contd.)
Reporting Best Practices : The size of the paper in the printer The length or the contents of the labels used in the user's language The length of the fields and extended data types at the user's installation The number of dimensions at the user's installation How dates and numbers are formatted The size of amounts in the user's system The sort order of the data sent to the report If the user wants to print only the totals or subtotals W hat font and size the user has set up as report defaults
REPORT ADJUSTMENTS(Contd.)
Report Design: AutoDesignSpecs GeneratedDesign Sections within a Report : Prolog PageHeader Section Group(Header, Footer, Body) PageFooter Epilog ProgrammableSection
REPORT ADJUSTMENTS(Contd.)
How Report Looks:
X++ OVERVIEW
X++ is the programming language that is used in the MorphX Development environment. key features Reliable - X++ provides extensive compile-time checking, followed by a second level of run-time checking. High Performing Interpreted and Dynamic Interoperable - Components in Microsoft Dynamics AX are seamlessly accessible to any application supporting the Component Object Model (COM) standard and .NET assembles.
Development Tools
Development Tools(Contd.)
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)} e.g. CustInvoicePrintout
All names must be in U.S. English. The default rule is to use logical and descriptive names if no other specialized rules apply. Identifier names have a limit of 40 characters. Names in the Application Object Tree (AOT) and in X++ code must correspond to the names in the U.S. English user interface. Names must be spelled correctly. Names must be used consistently. Do not begin a name with aaa, or CopyOf.
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>
Variable Declaration: dataType variableIdentifier; Array Declaration: real realUnlimtedArray[]; real realLimitedArray[10];
// the container has 3 values set // the third element is printed // Variables being set
Code syntex is just like c#, c++ if (condition) { //if true these statements are executed } else { //if false these statements are executed }
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
// To Loop Records
while select AccountNum, Name, Address from CustTable { print CustTable.AccountNum+ ": " + CustTable.Name + ": " + CustTable.Address; } pause;
Count
select count(AccountNum) from CustTable; print CustTable.AccountNum; pause;
Sort
CustTable CustTable; ; while select CustTable Index AccountIdx //while select CustTable Order By AccountNum desc { Print CustTable.AccountNum; } pause;
SalesTable SalesTable; ; update_recordset SalesTable setting salesName = "Update RecordSet", DeliveryStreet = "New Address" where SalesTable.CustAccount == "1102 ; info("Updated Successfully via RecordSet");
Transaction Integrity Checking It is important to ensure the integrity of all transactions within the system. W hen a transaction begins, to ensure data consistency, it must finish completely with predictable results. The following keywords help in integrity checking: ttsbegin Indicates the beginning of the transaction. ttscommit Indicates the successful end of a transaction. This ensures the transaction performed as intended upon completion. ttsabort Used as an exception to abort and roll back a transaction to the state before the ttsbegin.
QueryRun()
QueryRun() class starts this framework dynamically.
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."); } }
Questions
If you have any question/problem, I am here to answer sohaib.muhammad@m-consultants.com 0092 333 653 2823