presented by vishy grandhi. lesson 1: introduction to x++ lesson 2: development tools recipes
TRANSCRIPT
AX 2012 Development TrainingPresented by Vishy Grandhi
Lesson 1: Introduction to X++ Lesson 2: Development tools Recipes
Training Outline
At the end of this lesson you will have an understanding about◦ Overview◦ Characteristics◦ Code tools◦ Color coding
Introduction to X++: Objectives
Primary programming language used in MorphX development environment
Resembles other popular languages such as C# and Java
It includes many integrated SQL commands Object-oriented language Base set of system classes provide a wide
range of functionality include I/O, XML etc..
Introduction to X++: Overview
Reliable: Compile-time checking and run-time checking
Memory management: Automatic garbage collection
Interpreted and Dynamic: Faster dev cycles including prototyping
Interoperable: .Net interoperable and can consume external managed code and COM objects
Introduction to X++: Characteristics
X++ Editor X++ Compiler X++ Debugger Visual Studio Visual Studio Debugger
Introduction to X++: Code tools
◦ Editor color-codes
Introduction to X++: Color coding
Color Code typ
Blue Reserved words
Green Comments
Dark Red Strings
Bright Red Numbers
Purple Labels
Black Everything else
Squiggly lines Errors
At the end of this lesson you will have an understanding about◦ Compiler: Output window◦ Debugger: Window panes◦ Compare tool◦ Type Hierarchy browser◦ Reverse Engineering◦ Best Practices
Development Tools: Objectives
Compile (F7) Add-Ins->Compile Forward Compiler output window elements
◦ Filter buttons◦ Reset button◦ Edit button◦ Import/Export button◦ Setup button
Development Tools: Compiler
Breakpoint (F9) Tools->Options Developer tab:Debug field Window Panes in debugger
◦ Code◦ Variables◦ Call Stack◦ Watch◦ Breakpoints◦ Output
Development Tools: Debugger
Compare code in ◦ Two different layers◦ In an old version of an element◦ In two different elements◦ An element that will be imported
Development Tools: Compare
Add-Ins->Type hierarchy browser Display the hierarchy of a type inheritance Eg CustAccount, CustInvoiceAccount,
SalesLineType_Sales
Development Tools: Type hierarchy browser
Reverse engineer object and data models. Objects and the available models
Development Tools: Reverse engineering
Data Model Object Model
Tables Yes Yes
Table Group Property Yes
Table Fields Yes Yes
Table Index information Yes
Table Methods and parameters
Yes
Classes Yes
All EDTs Yes Yes
All Base Enums Yes Yes
All X++ Data Types Yes Yes
Naming Conventions: {business area name} + {business area description} + {action performed (for classes) or type of contents (for tables)}
All names in U.S. English Limit of 40 characters for identifiers All text must use labels Don’t begin any objects with prefix DEL_
Development Tools: Best Practices
Code Placement◦ Place in class to make it reusable◦ Code included in forms always runs on the client◦ Context ◦ Place code nearest to the source so it can be
more easily manipulated
Development Tools: Best Practices
Comments◦ In-Line vs Separate lines◦ //, /* */, TODO, ///◦ Add-Ins->Extract XML documentation
Development Tools: Best Practices
The following recipes are included in this presentation5a. Reverse engineer an object model5b. Reverse engineer a data model
Recipes: List of recipes
1. Start
2. Open Microsoft Dynamics AX development workspace (Ctrl + Shift + W)
3. Create a project.
4. Drag AOT elements into the project you want to reverse engineer into an object model.
5. Right-click the project and select Add-ins > Reverse engineer.
6. Click Visio UML Object model to create a UML object model.
7. Select a name and path for the file and then click OK.
8. From Microsoft Visio, drag object nodes into the center grid to lay out the desired model.
9. Finish
Recipe 5a: Reverse engineer an object model
1. Start
2. Open Microsoft Dynamics AX development workspace (Ctrl + Shift + W)
3. Create a project.
4. Drag the AOT elements into the project you want to reverse engineer into a data model.
5. Right-click the project and select Add-ins > Reverse engineer.
6. Click Visio UML Data model to create a UML data model.
7. Select a name and path for the file and then click OK.
8. From Microsoft Visio, drag table nodes into the center grid to lay out the desired model.
9. Finish
Recipe 5b: Reverse engineer a data model
We have looked at an Introduction to X++ and the various tools, best practices
Summary of Training