ax2012 enus wn dev 02

28
Chapter 2: MorphX CHAPTER 2: MORPHX Objectives The objectives are: Demonstrate Models and the SQL Server-based Model repository. Learn about the separation of the development from the application experience as a new workspace. Introduce the improvements made to the X++ Editor. Learn about the deployment of label files within a model store. Learn how to browse type hierarchies in the application model. This includes table inheritance, by using the Type Hierarchy Browser and Type Hierarchy Context window. Discuss the improvements made to the Reverse Engineering Tool. Introduction Microsoft Dynamics ® AX 2012 is an innovative release that brings users improved and new functionality. This version introduces many new features in both the technical and application areas. The new features improve the way both users and developers interact daily with the application, and how they customize and setup the application to fit their individual needs. 2-1 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Upload: silvia-bedejova

Post on 11-Nov-2015

53 views

Category:

Documents


10 download

TRANSCRIPT

  • Chapter 2: MorphX

    CHAPTER 2: MORPHX Objectives

    The objectives are:

    Demonstrate Models and the SQL Server-based Model repository. Learn about the separation of the development from the application

    experience as a new workspace. Introduce the improvements made to the X++ Editor. Learn about the deployment of label files within a model store. Learn how to browse type hierarchies in the application model. This

    includes table inheritance, by using the Type Hierarchy Browser and Type Hierarchy Context window.

    Discuss the improvements made to the Reverse Engineering Tool.

    Introduction Microsoft Dynamics AX 2012 is an innovative release that brings users improved and new functionality. This version introduces many new features in both the technical and application areas. The new features improve the way both users and developers interact daily with the application, and how they customize and setup the application to fit their individual needs.

    2-1

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Model Repository In earlier releases of Microsoft Dynamics AX the setup program installs deployment files, such as the Application Object Data (AOD) and Application Label Data (ALD) files on a file share. In Microsoft Dynamics AX 2012, the application file share is no longer required. The application files on the application share are organized and moved to different containers as described in the following list:

    The content of the AOD files are now stored in the model store and alternate model store.

    The ALD files are stored in the model store. The help files are rendered by the Help Server. Static files are either moved to the file system in the Application

    Object Server (AOS) instances, or converted into standard Application Object Tree (AOT) resources.

    Model store is stored in the SQL database. The main benefits of moving to a SQL Server based Model are:

    Partners can fully take advantage of SQL capabilities and the back-end tool set.

    Cross reference information is more tightly included with the model data.

    Labels files are moved to the SQL database and integrated with model data.

    Moving toward one technology means less to maintain. Much richer tracing and diagnostic capabilities.

    SQL Server-based Model Store

    The earlier releases of Microsoft Dynamics AX store metadata in the application files, also known as the AOD files, on a file share. The Application Object Server (AOS) reads the application files to retrieve the necessary objects at run time. In Microsoft Dynamics AX 2012, the AOD files are replaced by a SQL Server database named the model store. The AOS retrieves the metadata from the model store instead of AOD files. The model store consists of one or more application models within each application layer. A model is a set of unique model elements in a specific layer. Each element in a layer must belong to only one model.

    Microsoft Dynamics AX 2012 contains sixteen layers. A system-generated model exists for all sixteen layers. For example, the VAR Model is the system-generated model for the VAR layer. The system generated models are used to install and start to work with the base Microsoft Dynamics AX system.

    2-2

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Models and Model Files

    A model is a logical grouping of elements in a layer. An element can exist in exactly one model in a layer. Examples of elements are a table or class. The same element can exist in a customized version in a model in a higher layer. New models are easy to create. 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.

    Model files, with an .axmodel extension, are the new artifact to handle models. A model file resembles an AOD file from earlier versions. However, the names or numbers are not limited.

    Management of Models

    Microsoft Dynamics AX 2012 provides the following options to manage models.

    AXUtil.exe command-line utility: A new command-line utility, called axutil.exe is used to work with models and model files. You can use this utility to create, export, import, uninstall, and list installed models. You can use the axutil.exe Help for an overview of various commands and parameters used by each command. The setup program uses this utility to install the Microsoft Dynamics AX application.

    Programmatically: Developers can use the dynamic link library (DLL), which is called axutilib.dll, to create custom interfaces to manage models.

    PowerShell cmdlets: A group of PowerShell cmdlets are available to manage models and model files. You can use the PowerShell cmdlets to create, export, import, uninstall, and list installed models. You can also use the PowerShell cmdlets to create scripts to perform actions repeatedly. You can use the PowerShell Get -Help cmdlet for more information about the cmdlets.

    Managing Models Using AXUtil.exe

    AXUtil.exe is a command-line tool that is used to import and export application model data as .axmodel files into the SQL Server-based model store. You can also use AXUtil.exe to delete one or more models, create new empty models, and list models in a layer.

    Scenario: AXUtil.exe/? Command

    Isaac, the Developer, is new to Microsoft Dynamics AX 2012, and he wants to learn about the new axutil.exe tool. He is using the axutil.exe/? command for an overview of various commands and parameters that are used by each command.

    2-3

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Procedure: AXUtil.exe/? Command

    To review the various commands and parameters used by each command in the command-line utility axutil.exe, follow these steps:

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory. cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    NOTE: The default path for the administrative utility (axutil.exe) is :\Program Files\Microsoft Dynamics AX\60\Server\\Bin folder.

    2-4

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    3. Open the administrative utility axutil.exe. 4. Enter the command axutil.exe /? and then click Enter. 5. Review the various commands and parameters that are used by each

    command.

    FIGURE 2.1 AXUTIL.EXE HELP COMMAND

    2-5

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Usage of AOD Files

    AOD files are no longer used and are replaced by the model store. You can load AOD files from earlier Microsoft Dynamics AX versions into the new model store during version upgrade or on the Tools menu by clicking Tools > Code upgrade > Import AOD File.

    FIGURE 2.2 IMPORT AOD FILE

    Current Model versus Start-up Model

    All development work, such as creating a new class, will become part of the current model in the current layer. You can change the current model by clicking the name of the current model in the status line, the same as changing the current company.

    2-6

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    The current model can be set at the Microsoft Dynamics AX command line (AxUtil.exe), or by selecting the startup model in the User Option. To set the startup model in User Options select Tools > Options > Development > Startup model.

    FIGURE 2.3 USER OPTIONS STARTUP MODEL

    2-7

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Displaying Model Tags

    The AOT supports displaying which model a particular element belongs to, in addition to the familiar layer tags. You can set up model indicators in User Options by clicking Tools > Options > Development >Application Object Tree > Application object model.

    FIGURE 2.4 USER OPTIONS FOR DISPLAYING MODEL TAGS

    2-8

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Moving Model Elements

    Any element created in the current layer can easily be moved to another model in the same layer. You can move an element by selecting the element in the AOT, right-clicking the element and then selecting Move to model.

    FIGURE 2.5 MOVE ELEMENTS TO A MODEL

    Scenario: Management of Models

    Isaac, the Developer, installed a Microsoft Dynamics AX 2012 development and test environment out of the box at a new customer site and he prepared the environment for custom development. He created a model in the user layer. Isaac changed some objects based on customer requests and tracked the changes in the model. He exported the model from the development environment and imported the model to the test environment.

    Procedure: Create and Use a Model

    To create and then use a new CONTOSO model in the user layer, follow these steps:

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    2-9

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    3. Enter the following command to list all current models: AxUtil.exe list.

    4. Enter the following command to add the "CONTOSO" model: AxUtil.exe create /model:CONTOSO /layer:USR.

    5. Enter the following command to list all current models. Notice that the "CONTOSO" model is now listed: AxUtil.exe list.

    6. Open Microsoft Dynamics AX 2012. 7. Open a Developer workspace. 8. Open the AOT in Microsoft Dynamics AX 2012. 9. Right-click the Classes node and select New Class. 10. Right-click the new class and select Rename. 11. Enter a name for the class. 12. Right-click the class and select Move to Model. 13. Select the CONTOSO model and then click OK. 14. Right-click the class and select Properties. 15. Verify the Model Property is set to the CONTOSO model. 16. Change the Current model by selecting Tools > Model

    Management > Change current model. 17. Select the CONTOSO model and then click OK.

    Procedure: Export a Model

    To export the CONTOSO model in the user layer, follow these steps:

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    3. Enter the following command export the "CONTOSO" model: AxUtil.exe export /file:c:\ContosoModel.axmodel /model:CONTOSO.

    Procedure: Delete a Model

    To delete the CONTOSO model, follow these steps:

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    3. Enter the following command to delete the "CONTOSO" model, and confirm with entering Y: AxUtil.exe delete /model:CONTOSO.

    4. Enter the following command to list all current models. Notice that the "CONTOSO" model is no longer listed: AxUtil.exe list.

    2-10

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Procedure: Import a Model

    To import the CONTOSO model in the user layer, follow these steps:

    1. Re-create the class in the User Model with the same class name as in the previous procedure.

    2. Right-click the Classes node and select New Class. 3. Right-click the new class and select Rename. 4. Enter the same name for the class as used in the previous procedure. 5. Right-click the class and select New > Method to create a new

    method. 6. Save the class. 7. Go to Start > All Programs > Accessories > Command Prompt. 8. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    9. Enter the following command to add the "CONTOSO" model: AxUtil.exe import /file:c:\ContosoModel.axmodel /layer:USR /conflict:push.

    10. Enter the following command to list all current models. Notice that the "CONTOSO" model is now listed: AxUtil.exe list.

    11. Make sure that the model is imported in the USR layer and a Conflict model is created in the USP layer.

    2-11

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Lab 2.1 - Management of Models This lab will demonstrate how to manage models by using the AXUtil.exe command.

    Scenario

    Isaac, the Developer, installed a Microsoft Dynamics AX 2012 development and test environment out of the box at a new customer site and he prepared the environment for custom development. He created a model called Demo1 in the user layer. Isaac then changed some objects based on customer requests and tracked the changes in the Demo1 model. When he is finished, he exported the Demo1 model from the development environment and imported the model to test.

    Challenge Yourself: Create a Model

    Use the information that is provided to create a model.

    Challenge Yourself: Export a Model

    Use the information that is provided to export a model.

    Challenge Yourself: Delete a Model

    Use the information that is provided to uninstall a model.

    Challenge Yourself: Import a Model

    Use the information that is provided to import a model.

    Need a Little Help?: Create and Use a Model 1. Create a new model by using the AxUtil.exe command. 2. Open the AOT in Microsoft Dynamics AX 2012. 3. Create a new class. 4. Move the class to the model.

    Need a Little Help?: Export a Model Export the model by using the AxUtil.exe command.

    Need a Little Help?: Uninstall a Model Uninstall the model by using the AxUtil.exe command.

    2-12

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Need a Little Help?: Import a Model

    1. Re-create the class in the User model. 2. Import the previously exported model by using the AxUtil.exe

    command. 3. Make sure that the model is imported and a Conflict model is

    created in the USP layer.

    Step by Step: Create and Use a Model

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    3. Enter the following command to list all current models: AxUtil.exe list.

    4. Enter the following command to add the "DEMO1" model: AxUtil.exe create /model:DEMO1 /layer:USR.

    5. Enter the following command to list all current models. Notice that the "DEMO1" model is now listed: AxUtil.exe list.

    6. Open the AOT in Microsoft Dynamics AX 2012. 7. Right-click the Classes node and select New Class. 8. Right-click the new class and select Rename. 9. Enter a name for the class. 10. Right-click the class and select Move to Model. 11. Select the model and then click OK. 12. Right-click the class and select Properties. 13. Verify the Model Property is set to the model created in Step 2. 14. Change the Current model by selecting Tools > Model

    Management > Change current model. 15. Select the model and then click OK.

    Step by Step: Export a Model

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    3. Enter the following command export the "DEMO1" model: AxUtil.exe export /file:c:\DEMO1.axmodel /model:DEMO1.

    2-13

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Step by Step: Delete a Model

    1. Go to Start > All Programs > Accessories > Command Prompt. 2. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    3. Enter the following command to delete the "DEMO1" model, and then click Yes when prompted: AxUtil.exe delete /model:DEMO1.

    4. Enter the following command to list all current models. Notice that the "DEMO1" model is no longer listed: AxUtil.exe list

    Step by Step: Import a Model

    1. Re-create the class in the User Model with the same class name as in the previous procedure.

    2. Right-click the Classes node and select New Class. 3. Right-click the new class and select Rename. 4. Right-click the class and select New > Method to create a new

    method. 5. Save the class. 6. Go to Start > All Programs > Accessories > Command Prompt. 7. Enter the following command to go to the appropriate directory: cd

    "c:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Bin".

    8. Enter the following command to add the "DEMO1" model: AxUtil.exe import /file:c:\DEMO1.axmodel /layer:USR /conflict:push.

    9. Enter the following command to list all current models. Notice that the "DEMO1" model is now listed: AxUtil.exe list.

    10. Make sure that the model is imported and a Conflict model is created in the USP layer.

    2-14

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Development Workspace In Microsoft Dynamics AX 2012, the development experience is separated from the application experience as a new workspace. The developer workspace contains all the tools and features a developer needs for creating and customizing a Microsoft Dynamics AX application. Saved changes in the Development Workspace are always synchronized with the Application Workspace within the same client instance. There can be eight workspaces in total of either type for each client instance. Application elements can still be opened in the AOT, or you can open an Application Workspace from the Development Workspace to view your customizations.

    FIGURE 2.6 DEVELOPMENT WORKSPACE

    X++ Editor In Microsoft Dynamics AX 2012, a new X++ Editor is introduced which replaces the current legacy editor. The new X++ Editor is based on hosting a Visual Studio 2010 Editor Framework control. The new editor provides equivalent functionality compared to the editor included in earlier Microsoft Dynamics AX versions to make sure continued developer productivity and to meet current user expectations.

    Main advantages include:

    Provides an editing experience close to Visual Studio. Improves IntelliSense. Guidance during code writing, such as XML documentation on

    parameter help.

    2-15

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Richer code rendering, such as better formatting and syntax coloring, tooltips for labels and errors.

    Better integration with MorphX tools, such as Cross-reference. Feature Overview

    The following features are added or updated to improve the X++ editor:

    Shortcut keys are changed and added to match Visual Studio. Autocomplete is added for variables, keywords, built-in functions,

    compiler functions, and types. Method parameter help can now span multiple lines, supports

    multiple signatures, and supports XML documentation comments. All compiler output issues are now indicated by a squiggle. When

    resting on the squiggle, the compiler output text inline is displayed. Insert scripts inline by typing the script name and then pressing

    TAB. Insert a header by using triple slash ///. HOME behavior is aligned with Visual Studio. Improved block selection and editing. More granular word selection and syntax coloring. Review label text as a tooltip for a label ID in code. Use shortcuts to comment or uncomment a selection of code. Lookup definition is extended with model elements. Indent is aligned with code structure. Changes can be tracked because the code is last opened or last saved. Line numbers are included in code. Zoom in on code to make the code easier to read. Viewing and toggling breakpoints in the editor margin. Improved inline interactive search to keep the focus in the editor.

    X++ Attributes

    X++ classes and methods can now be decorated with metadata in the form of attribute classes. An attribute class is any non-abstract class that inherits from the SysAttribute class. Detailed metadata is assigned through the constructor of the attribute class.

    2-16

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Scenario: Developer Experience

    Isaac, the Developer, needs an editor to create code. The editor must have an appropriate set of statement capabilities to enable editing code such as selecting, navigating, and IntelliSense. In addition the editor will support the special requirements of X++ development, such as integration with label subsystem, source control, AOT, Cross-reference, help and the X++ compiler and debugger.

    Use the following code sample in the following procedures.

    static void main(Args _args) { CustTable custTable; str custName; ; select firstonly * from custTable; if(custTable) { //Display customer name custName = custTable.name(); info(strfmt("The customer name is %1.", custName)); } info("Completed"); }

    Procedure: Basic Features

    To demonstrate the basic X++ Editor features, follow these steps:

    1. Open Microsoft Dynamics AX 2012. 2. Open a Developer workspace and open the AOT. 3. Right-click the Classes node. 4. Select New Class. By default the class will be named Class1. 5. Double-click Class1. 6. Change Class1 to MyClass1 and then click Save. 7. Verify the class is also renamed in the AOT. 8. Select the class and add a new method by using CTRL+N. 9. Make sure that the new method appears in the Method list of the

    editor, and in the AOT. 10. Change the method to a static method and change the name to main. 11. Click Save. 12. Make sure that the class is also renamed in the AOT. 13. Type the provided code sample. 14. Notice that, although typing in the code editor the text is

    automatically indented according to structure and syntax coloring and code rendering has improved, and real time IntelliSense is available while typing.

    2-17

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    15. Enter "///" above the method declaration to provide document comments.

    16. Type "This is the X++ Editor Demo method" as a summary comment.

    17. Enter "Args parameter" within the param name ="a" tag. 18. Create a new job in the AOT and call this class. Review the XML

    document and the parameter help.

    FIGURE 2.7 DOCUMENT HELP

    Procedure: Metadata and Labels

    To show metadata within the X++ Editor, follow these steps:

    1. In the main method, right-click the CustTable. 2. Select Lookup definition to browse to the metadata for an object in

    code. 3. Back in the X++ Editor, select the string Completed. 4. Right-click and select Lookup label/Text to call up the Label dialog

    box. 5. Select Label ID "@SYS54623" and then click Paste. 6. Complete the dialog by clicking Paste label and make sure that the

    Label ID is inserted in code. 7. Hover over the Label ID to make sure that the actual label value is

    visible.

    Procedure: Code Compile

    To show a code error within the X++ Editor, follow these steps:

    1. Create a coding error by changing "strfmt" to "strft". 2. Click Compile. 3. Verify the automatic compilation marks the incorrect code with a red

    squiggly line. 4. Correct the mistake and then click Save.

    NOTE: Best Practice errors are identified with a purple squiggly line if the compile Level is set to Level 4 in the Compiler Setup parameters.

    2-18

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Procedure: Track Changes

    To track changes within the X++ Editor, follow these steps:

    1. Click the Toggle change tracking margin button in the X++ Editor toolbar to turn on track margin.

    2. Add a new variable called "str custAccountNum;" 3. Click the Save icon. 4. Verify it is possible to identify the code that has been changed since

    the last save by viewing the glyph bar in the left side of the editor.

    FIGURE 2.8 X++ EDITOR

    Scenario: Debug Experience

    Isaac, the Developer, has created some X++ business logic, and he wants to add breakpoints and debug the method to verify the code works as expected.

    Procedure: Debug Experience

    To debug a class within Microsoft Dynamics AX 2012, follow these steps:

    1. Create an error by removing the double quotation after the complete string.

    2. Click Go in the X ++ Editor toolbar to run the class. 3. Note that the X++ code is automatically compiled and the system

    logs a compile error and stops execution. 4. Double-click the compile error line in the Compiler output

    window. 5. Verify the system opens the myClass main method. 6. Correct the mistake by adding the double quotation back in and press

    F5 to run the class.

    2-19

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    7. Verify the X++ code now compiles. 8. Verify the correct text is shown in the Infolog. 9. Within the X++ Editor click the editor gutter to set a breakpoint at

    the "select firstOnly * from custTable;" line. 10. Press F5 to run the class. 11. Verify the code is automatically compiled and executed. 12. Verify that execution is then stopped in the external debugger tool at

    the line with the breakpoint. 13. Click F10 to step through code execution. 14. Close the debugger window and the AOT.

    Label Files in MorphX In Microsoft Dynamics AX 2012, working with labels and label files remains the same. Examples include using the label file wizard, label editor, and label files on disk. However, there are significant enhancements in the deployment of label files. This occurs because of infrastructure changes of the model store. In the earlier releases, the system administrator had to manually copy label files from one environment to another. In Microsoft Dynamics AX 2012, the label files are installed as part of the model file. Developers can view and import label (ALD) files in the Labels node in the Application Object Tree (AOT).

    FIGURE 2.9 LABEL FILES NODE IN THE AOT

    2-20

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Scenario: Import .ald File

    Isaac, the Developer, wants to make an .ald file part of the model. He wants to import the label file into the model store.

    Procedure: Import .ald File

    To import the label file into the model store, follow these steps:

    1. Open the AOT. 2. In the AOT right-click the Label Files node. 3. Click Create from file. 4. Select the .ald file. 5. Click OK.

    Type Hierarchy Views The Application Hierarchy Tree is improved and is now called the Type Hierarchy Browser. It enables browsing type hierarchies in the application model, including table inheritance. It also provides a view of members across the hierarchy. The view provides navigation to edit the method members.

    Another productivity tool that is introduced in Microsoft Dynamics AX 2012 is called the Type Hierarchy Context. The Type Hierarchy Context provides contextual hierarchy information about types. It can be docked in the developer workspace. When you select a node in the AOT, it shows the parents from the object to the built-in kernel base types. You can navigate to the Type Hierarchy Browser for any of the nodes in the context hierarchy.

    FIGURE 2.10 TYPE HIERARCHY BROWSER

    2-21

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Scenario: Use the Type Hierarchy Browser

    Isaac, the Developer, is customizing the Finance module, an area in which he is an expert. He has also been asked to customize the Account Receivable functionality, and area unfamiliar to him. Therefore he accesses the Type Hierarchy Browser and Type Hierarchy Context on the Tools menu, to browse the type hierarchies in the application model, including table inheritance to learn about the parents and children relationship of application objects.

    Procedure: Use the Type Hierarchy Browser

    To review object relations in the Type Hierarchy Browser, follow these steps:

    1. In the Developer workspace click Tools and then Type hierarchy browser.

    2. Select the objects to research and expand the object node to view extended objects.

    NOTE: Select specific tables with inheritance to demonstrate the Type Hierarchy Browser.

    3. Close the Type Hierarchy Browser.

    To review object relations in the Type Hierarchy Context, follow these steps:

    1. Create a project. 2. Drag the AOT objects into the project that you want to review.

    NOTE: Select specific tables with inheritance to demonstrate the Type Hierarchy Context.

    3. Click Tools and then Type Hierarchy Context. 4. Review the objects in the Type Hierarchy Context window. 5. Close the Type Hierarchy Context window.

    FIGURE 2.11 TYPE HIERARCHY CONTEXT

    2-22

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Reverse Engineering Tool Reverse engineering is a feature that is used by partners to easily retrieve detailed information about the structures and relationships of the Microsoft Dynamics AX business logic and data model. In Microsoft Dynamics AX 2012, the reverse engineering tool is improved to support table inheritance and automatically includes parent elements in the generated models.

    The Reverse Engineering tool lets you visualize data and object models generated from projects in Microsoft Dynamics AX. These models are created as Microsoft Visio documents. To open the Reverse Engineering tool, right-click a project and select Add-ins > Reverse Engineer.

    FIGURE 2.12 REVERSE ENGINEERING TOOL

    Scenario: Reverse Engineering the Data Model

    Isaac, the Developer, is customizing the Finance module, an area in which he is an expert. He has also been asked to customize the Project management functionality, an area unfamiliar to him. Therefore he creates a development project and includes some objects that make sense to analyze. He right-clicks the project and selects the Reverse Engineer entry in the Add-in shortcut menu to access a structured overview of the data relationships in Microsoft Visio.

    Procedure: Reverse Engineering the Data Model

    To generate a data model that is based on objects included in a project, follow these steps:

    1. Create a project. 2. Drag the AOT objects into the project that you want to reverse

    engineer into a data model.

    2-23

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    NOTE: Select specific tables with inheritance to demonstrate the improvements made to reverse engineering.

    3. Right-click the project and select Add-ins > Reverse Engineer. 4. Click Visio UML data model to create an UML data model. 5. Select a name and path for the file and then click OK. 6. Within Microsoft Visio drag table nodes into the center grid to layout

    the desired model.

    Summary Microsoft Dynamics AX 2012 is an innovative release that brings users improved and new functionality. The following main concepts are introduced:

    Application model data is now stored in a SQL Server database, similar to the business data.

    The Application Hierarchy Tree, now called Type Hierarchy Browser, enables browsing type hierarchies in the application model, including table inheritance.

    The reverse engineering tool supports table inheritance and automatically includes parent elements in the generated models.

    Label files are installed as part of the model file. Development experience is separated from the application

    experience as a new workspace. A new X++ Editor, based on hosting a Visual Studio 2010 Editor

    Framework control, replaces the current legacy editor.

    2-24

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Test Your Knowledge

    1. True or false, in Microsoft Dynamics AX 2012 the reverse engineering tool is enhanced to supports table inheritance and will automatically include parent elements in the generated models.

    ( ) True - the reverse engineering tool supports table inheritance. ( ) False - the reverse engineering tool only supports class inheritance.

    2. Which of the following are true statements about the new model repository in Microsoft Dynamics AX 2012? (Select all that apply)

    ( ) The AOD files are now stored in the model store and old model store. ( ) The ALD files are now stored in the model store. ( ) The Help files are now rendered by the Help Server. ( ) Static files are either moved to the file system in the AOS instances,

    or converted into standard Application Object Tree (AOT) resources.

    3. Which of the following are advantages of the new Microsoft Dynamics AX 2012 X++ Editor? (Select all that apply)

    ( ) Better integration with MorphX tools, such as Cross reference. ( ) Increases the cost of adding editor tests because of the extension of

    UIAutomation. ( ) Richer code rendering, such as better formatting and syntax coloring,

    tooltips for labels and errors. ( ) Guidance during code writing, such as XML documentation on

    parameter help.

    4. True or false, in Microsoft Dynamics AX 2012, the setup program installs the label (ALD) files on a file share.

    ( ) True - the label files are installed on the file share. ( ) False - the label files are installed as part of the model file.

    2-25

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    Quick Interaction: Lessons Learned Take a moment and write down three key points you have learned from this chapter

    1.

    2.

    3.

    2-26

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • Chapter 2: MorphX

    Solutions Test Your Knowledge

    1. True or false, in Microsoft Dynamics AX 2012 the reverse engineering tool is enhanced to supports table inheritance and will automatically include parent elements in the generated models.

    () True - the reverse engineering tool supports table inheritance. ( ) False - the reverse engineering tool only supports class inheritance.

    2. Which of the following are true statements about the new model repository in Microsoft Dynamics AX 2012? (Select all that apply)

    () The AOD files are now stored in the model store and old model store. () The ALD files are now stored in the model store. () The Help files are now rendered by the Help Server. () Static files are either moved to the file system in the AOS instances,

    or converted into standard Application Object Tree (AOT) resources.

    3. Which of the following are advantages of the new Microsoft Dynamics AX 2012 X++ Editor? (Select all that apply)

    () Better integration with MorphX tools, such as Cross reference. ( ) Increases the cost of adding editor tests because of the extension of

    UIAutomation. () Richer code rendering, such as better formatting and syntax coloring,

    tooltips for labels and errors. () Guidance during code writing, such as XML documentation on

    parameter help.

    4. True or false, in Microsoft Dynamics AX 2012, the setup program installs the label (ALD) files on a file share.

    ( ) True - the label files are installed on the file share. () False - the label files are installed as part of the model file.

    2-27

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

  • What's New - Technical in Microsoft Dynamics AX 2012 for Development

    2-28

    Microsoft Official Training Materials for Microsoft Dynamics

    Your use of this content is subject to your current services agreement

    Chapter 2: MORPHXObjectivesIntroductionModel RepositorySQL Server-based Model StoreModels and Model FilesManagement of ModelsManaging Models Using AXUtil.exeScenario: AXUtil.exe/? CommandProcedure: AXUtil.exe/? CommandUsage of AOD FilesCurrent Model versus Start-up ModelDisplaying Model TagsMoving Model ElementsScenario: Management of ModelsProcedure: Create and Use a ModelProcedure: Export a ModelProcedure: Delete a ModelProcedure: Import a ModelScenario

    Challenge Yourself: Create a ModelChallenge Yourself: Export a ModelChallenge Yourself: Delete a ModelChallenge Yourself: Import a ModelNeed a Little Help?: Create and Use a ModelNeed a Little Help?: Export a ModelNeed a Little Help?: Uninstall a ModelNeed a Little Help?: Import a ModelStep by Step: Create and Use a ModelStep by Step: Export a ModelStep by Step: Delete a ModelStep by Step: Import a Model

    Development WorkspaceX++ EditorFeature OverviewX++ AttributesScenario: Developer ExperienceProcedure: Basic FeaturesProcedure: Metadata and LabelsProcedure: Code CompileProcedure: Track ChangesScenario: Debug ExperienceProcedure: Debug Experience

    Label Files in MorphXScenario: Import .ald FileProcedure: Import .ald File

    Type Hierarchy ViewsScenario: Use the Type Hierarchy BrowserProcedure: Use the Type Hierarchy Browser

    Reverse Engineering ToolScenario: Reverse Engineering the Data ModelProcedure: Reverse Engineering the Data Model

    SummaryTest Your KnowledgeQuick Interaction: Lessons LearnedSolutions