Professional Documents
Culture Documents
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Last Revision: June 2008 The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Server and Microsoft Dynamics AX 2009 MorphX are trademarks or registered trademarks of Microsoft Corporation. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. This course content is designed for Microsoft Dynamics AX 2009.
2008 Microsoft Corporation. All rights reserved. Microsoft Dynamics, Microsoft PowerPoint Microsoft SQL
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Welcome ............................................................................................................ 0-1 Microsoft Dynamics Courseware Contents ........................................................ 0-2 Documentation Conventions .............................................................................. 0-3 Student Objectives ............................................................................................. 0-4
1-1
Objectives ........................................................................................................... 1-1 Introduction ......................................................................................................... 1-1 Features of Microsoft Dynamics AX 2009 .......................................................... 1-2 Microsoft Dynamics AX 2009 Application Essentials ......................................... 1-6 Lab 1.1 - Filtering Records on the Customer Form .......................................... 1-17 Microsoft Dynamics AX 2009 Layered Architecture ......................................... 1-18 Tools for Customization .................................................................................... 1-26 Lab 1.2 - Moving a Column .............................................................................. 1-29 Security ............................................................................................................ 1-30 Inquiry and Reports .......................................................................................... 1-36 Lab 2.3 - Creating a Simple Inquiry on an Auto-Report.................................... 1-43 Summary .......................................................................................................... 1-44 Test Your Knowledge ....................................................................................... 1-45 Quick Interaction: Lessons Learned ................................................................. 1-46 Solutions ........................................................................................................... 1-47
2-1
Objectives ........................................................................................................... 2-1 Introduction ......................................................................................................... 2-1 MorphX and the Application Object Tree............................................................ 2-1 Tables ................................................................................................................. 2-5 Creating Tables ................................................................................................ 2-11 Lab 2.1 - Table Creation ................................................................................... 2-17 Relations .......................................................................................................... 2-19 Data Types Primitive and Extended .............................................................. 2-22 Base Enumerations (Base Enums) .................................................................. 2-30 Maps ................................................................................................................. 2-34 Views ................................................................................................................ 2-35 Lab 2.2 - Views ................................................................................................. 2-41 Indices .............................................................................................................. 2-43 Lab 2.3 - Indices ............................................................................................... 2-46 Summary .......................................................................................................... 2-46 Test Your Knowledge ....................................................................................... 2-47 Solutions ........................................................................................................... 2-49
3-1
Objectives ........................................................................................................... 3-1 Introduction ......................................................................................................... 3-1 Projects .............................................................................................................. 3-2 Forms ................................................................................................................. 3-4 Lab 3.1 - Forms Creation ................................................................................. 3-16 Menus Items in MorphX ................................................................................... 3-19
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-1
Objectives ........................................................................................................... 4-1 Introduction ......................................................................................................... 4-1 The Visual Report Designer ............................................................................... 4-2 Report Design .................................................................................................... 4-5 Report Templates ............................................................................................. 4-12 Summary .......................................................................................................... 4-15 Test Your Knowledge ....................................................................................... 4-16 Quick Interaction: Lessons Learned ................................................................. 4-17 Solutions ........................................................................................................... 4-18
ii
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
Online Training
Online Training delivers convenient, in-depth training to you in the comfort of your own home or office. Online training provides immediate access to training 24 hours-a-day. It is perfect for the customer who does not have the time or budget to travel. Our newest online training option, eCourses, combine the efficiency of online training with the in-depth product coverage of classroom training, with at least two weeks to complete each course.
Classroom Training
Classroom Training provides serious, in-depth learning through hands-on interaction. From demonstrations to presentations to classroom activities, you receive hands-on experience with instruction from our certified staff of experts. Regularly scheduled throughout North America, you can be sure you will find a class convenient for you.
Training Materials
Training Materials enable you to learn at your own pace, on your own time with information-packed training manuals. Our wide variety of training manuals feature an abundance of tips, tricks, and insights you can refer to again and again:
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
0-1
Challenge Yourself!
Level 3 exercises are the most challenging. These exercises are designed for the experienced student who requires little instruction to complete the required task.
Step by Step
Level 1 exercises are geared towards new users who require detailed instructions and explanations to complete the exercise. Level 1 exercises guide you through the task, step by step, including navigation.
0-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
Documentation Conventions
The following conventions and icons are used throughout this documentation to help you quickly and effectively navigate through the information.
CAUTION: Cautions are found throughout the training manual and are preceded by the word CAUTION in bold. Cautions are used to remind you of a specific result of a specific action which may be undesirable. HINT: Hints are found throughout the training manual and are preceded by the word HINT in bold. Hints are used to suggest time-saving features or alternative methods for accomplishing a specific task. NOTE: Notes are found throughout the training manual and are preceded by the word NOTE in bold. Notes are used to provide information which, while not critical, may be valuable to an end user. BEYOND THE BASICS: Advanced information found throughout the training manual is preceded by the words BEYOND THE BASICS in bold. Beyond the Basics provides additional detail, outside of standard functionality, that may help you to more optimally use the application. EXAMPLE: Examples are found throughout the training manual and are preceded by the word EXAMPLE in bold. Examples bring to light business scenarios that may better explain how an application can be used to address a business problem.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
0-3
Student Objectives
What do you hope to learn by participating in this course? List three main objectives below. 1.
2.
3.
0-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
Microsoft Dynamics AX 2009 is a customizable, multiple-language, and multiple-currency Enterprise Resource Planning (ERP) solution. Microsoft Dynamics AX 2009 excels in: Manufacturing E-business Wholesale Services industries
Microsoft Dynamics AX 2009 is a completely integrated solution. It is Webenabled and supports Microsoft SQL Server and Oracle. With customizable source code, the solution can be modified however and whenever it is necessary.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-1
Development Environment Features o Microsoft Dynamics AX 2009 MorphX is an integrated development environment (IDE) for developing in Microsoft Dynamics AX 2009 The .NET Business Connector provides access to the complete Microsoft Dynamics AX 2009 API allowing for easy integration of third-party and Web applications to Dynamics Ax Classes The Application Object Tree (AOT) provides a uniform and compact programming framework and viewing repository Drag-and-drop functionality is supported for many programming tasks Projects help organize and track customized applications in Microsoft Dynamics AX 2009
o o o
1-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The AOS architecture is highly scalable. As a business grows and the number of Microsoft Dynamics AX 2009 users increase, expand the capacity of Microsoft Dynamics AX 2009 by adding an additional AOS to the second tier. The additional server provides load balancing and introduces failover safety into the environment.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-3
IntelliMorph
IntelliMorph is the technology that controls the user interface in Microsoft Dynamics AX 2009. The user interface is how the functionality of the application is presented or displayed to the user. The same functionality can be displayed on multiple platforms or devices that use the same application code; for example, through the Web or through Mobile devices. IntelliMorph controls the layout of the user interface and makes it easier to modify forms, reports, and menus.
MorphX
The MorphX Development Suite is the integrated development environment (IDE) in Microsoft Dynamics AX 2009 used to develop and customize both the Windows interface and the Web interface. An IDE integrates development functions such as designing, editing, compiling, and debugging within a common environment. With MorphX, common operations such as building or modifying forms, menus, and reports are done using drag-and-drop techniques with little or no coding.
1-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
X++ X++ is the object-oriented programming language that is used in the MorphX environment. When working with X++, reference the Microsoft Dynamics AX 2009 Developer Help, available from the Help menu. This manual introduces the X++ environment. Additional training offerings discuss X++ in detail.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-5
Area Page: An Area Page is a Microsoft Dynamics AX 2009 navigation page that displays menu items that link to list pages, content pages, forms, reports, classes, jobs, and queries. To view an area page, click a module button in the Navigation Pane. The area page opens in the client content pane that is automatically generated using the menu information for that module. The Area Page will be discussed in detail in a later course.
1-6
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
FIGURE 1.4
NOTE: The wavy red underline in empty fields indicates a mandatory field. The record cannot be saved until these fields contain data. The data is automatically saved into the database after moving away from the new record.
Sorting Records
When working with data in a form it is sometimes necessary to change the sort order of the data to find specific information more easily. Records can be sorted in a form using three different methods.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-7
3. Sort records by selecting either Sort Ascending or Sort Descending from the Edit/Sort menu in the menu bar. o To remove the sort order, click the Remove Filter icon in toolbar
Filtering Records
Sorting works well when working on a small set of data. However, to work efficiently with large amounts of data, filter the data to work with a specific subset of information. There are three ways to filter data in the user interface: Current content of a field Using an inquiry dialog where the criteria for the filter is specified Filter by grid
Using X++ code, there are many more ways to filter data; this chapter focuses on how to use MorphX utilities.
1-8
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
FIGURE 1.6
Now, only the sales orders for account number 3003 appear. 4. To remove this filter, click the Remove Filter icon on the toolbar.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-9
2. After clicking the Advanced Filter/Sort icon, an inquiry dialog appears where the criteria can be specified for the filter. Click the OK button to return to the sales order form where only the records reflecting the specific criteria appear. o Again, if necessary, click the Remove Filter icon in the toolbar to remove the current filter. Filtering by grid provides the option to select one of ten expressions in a filter for each field in the grid.
1. Click the Filter By Grid icon and select a filtering expression for the field.
1-10
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
FIGURE 1.10
Finding Records
Use the Global Search option to search for information across selected tables. There are three ways to start a Global Search. From the Menu Pane: Select the Find option on the Edit menu Select the Binocular icon from the toolbar Press Ctrl + F
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-11
1-12
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
5. On the Overview tab, add the Companies to be included in the Global Search.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-13
The Global Search is now ready to use. In addition to sorting and filtering, use the find functionality within Microsoft Dynamics AX 2009 to move to: A specific record. A range of records. A group of records that contains the same value or text.
The find functionality can be invoked in several ways. NOTE: Use wildcard characters (that is, ?, *) within the Find dialog to help broaden a search.
CAUTION: When using the Data Crawler with companies with large database tables, be aware of the significant time requirement for building indices on large tables.
1-14
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The sales person then select the Categories for the records to be displayed. The sales person then select Customer Transactions to receive a list of all transactions matching the search criteria and then click the specific order. This action opens the order directly from the list view.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-15
The Microsoft Dynamics AX 2009 Developer Help contains information specific to developing or customizing Microsoft Dynamics AX 2009 applications and can be accessed from the Microsoft Dynamics AX 2009 application help menu. The reference documentation within the Developer Help is also available by double-clicking the relevant object in the AOT. The AOT includes documentation on many application objects in Microsoft Dynamics AX 2009.
1-16
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Challenge Yourself!
The Customer form has many customers in different customer groups. Using the Filter by Selection functionality in Microsoft Dynamics AX 2009, filter the Customer details form to display only customers in Customer Group 30.
Step by Step
1. Open the Customer details form in the Accounts Receivable module. 2. Place the cursor in the Customer Group field that contains the value 30. 3. Right-click and select Filter by Selection from the shortcut menu. 4. To remove this filter, click the Remove Filter icon on the Toolbar.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-17
Each layer is saved in a separate file that has an extension of .aod. For example, Axsys.aod is the SYS layer. The aod extension is an acronym for Application Object Data file. The layers are designed for different Microsoft Dynamics AX 2009 developer groups. Three groups have an interest in adding or modifying application objects: Microsoft Business Solution Developers who create the standard application Business partners and developers who want to enhance Microsoft Dynamics AX 2009 Microsoft Dynamics AX 2009 end-users
1-18
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
NOTE: Object ID's in the standard layers are in the range of 1-20000. The four outermost layers (BUS, VAR, CUS, and USR) are modified by developers or end-users: BUS - Business partners can develop and distribute vertical and horizontal solutions to other partners and customers using the Business Solution or BUS layer
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-19
The business partner must keep a catalog of application functionality and VAR configurations customers have implemented to update installations correctly. VAR layer Object id's range from 30001 - 40000. CUS - Corporate enterprises and business partners can modify their installations using the Customer or CUS layer. If a corporate enterprise has an internal IT Department with Microsoft Dynamics AX 2009 programming skills, use this layer to add generic enterprise modifications
The Customer layer supports in-house development without jeopardizing modifications made by the business partner. This means application code made in the VAR layer cannot be changed. CUS layer object id's range from 40001 50000. USR - The USR layer enables individual companies or companies in an enterprise to use this layer to make customizations that are unique to the customers installation that includes reports by using the report wizard
Patch Layers
In addition to the seven layers, each layer has one patch layer to help incorporate updates into a current application. When a patch file is present, modified objects in the patch file take precedence over regular objects and are used automatically. Patch files for a specific layer are stored in files that have the extension aod and contain a p within the name. For example, Axsyp.aod is a patch file included in the system layer. Object layers are visible in the AOT. The layer in which an object resides is listed in parentheses after the object's name if this option is chosen. NOTE: Refer to Microsoft PartnerSource or CustomerSource for up to date information on deployment strategies for Service Packs and Hotfixes. NOTE: The Administration in Microsoft Dynamics AX 2009 course addresses the procedures for the application of Service Packs and Hotfixes.
1-20
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The menu choices are as follows: Show no layers - No objects are labeled with a layer indicator Show all layers - All objects are labeled with layer indications for all layers in which they exist Show highest layer - Shows only the highest layer where the object has been modified Show corrected layers - Shows only objects modified in the current layer or higher and labeled with indication of the highest layer Show all from corrected layers - Shows only objects modified in the current layer or a higher layer, with an indication of all layers of modification
NOTE: By using the Show All Layers option, a developer can see all layers that an object might reside in. This can allow the developer to use informed judgment when modifying an object.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-21
When creating a label file, a reference is made to a label data file (.ald) in the file system that stores all the label files numbers and text. The label files are allocated numerically, such as @SYS120 and @SYS121. Label files are stored in the application folder and use an extension of .ald. The .ald extension is an acronym for Microsoft Dynamics AX 2009 Label Data.
1-22
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
NOTE: Due to risk of overwriting label files during an upgrade, the following abbreviations should NOT be used: SYS, SYP, GLS, GLP, HFX, SL1, SL2, SL3, BUS, BUP, VAR, VAP, CUS, CUP, USR, USP.
1. Navigate to Tools > Development Tools > Label, and select Label file Wizard. This opens the Label File Wizard. 2. Select the Create a new label file ID field. In this case, only create a new label file ID. 3. Create a label file ID named MBS. This is how the system references the new label file. This ID must be unique and contain only three letters. 4. Click Finish. Before writing any newly created label files, shut down Microsoft Dynamics AX 2009 and restart.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-23
This is where the user searches for existing labels to use or add a custom label. 1. Type the name of the label in the Find what: field and then click Find now. The system searches all available label names to check if the label exists. If it exists, as long as the label is highlighted, the user can reuse it by selecting Paste label. If the label does not exist, create a new one by pressing CTRL + N. 2. Click the Advanced tab. When creating a new label, select which label file ID to create the new labels in.
1-24
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
NOTE: If the Version Control System is started the procedure is different. This is discussed in a later course.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-25
IntelliMorph
Intellimorph is the automatic layout generation of forms, reports, and menus.
1-26
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
IntelliMorph uses a drag-and-drop technique to rearrange fields on a form. For example, to rearrange the fields on the customer form: 1. Open the Customer form. 2. Click and hold the header for the Customer account column. 3. When holding down, drag it to the right of the header for the customer Search name column and drop it. NOTE: To enable this functionality, the Advanced Form Customizations option must be selected under the Administration node in the configuration key tree. The Configuration form is located in the Administration Module > Setup > System. Configuration keys are discussed later.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-27
MorphX
When customization requirements are beyond the basics of IntelliMorph, the next tool of choice is MorphX. Use MorphX to fulfill customization requirements, such as adding new fields to a report or form. The second chapter in this training focuses on MorphX development. In some cases, the customization may introduce new functionality into Microsoft Dynamics AX 2009, such as new or additional logic to process a sales order. Use X++ to create new or additional application logic.
X++
X++ is the development language Microsoft Dynamics AX 2009 is built upon. This course does not go into detail on the X++ environment. There are other training offerings available to learn more about X++.
1-28
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Challenge Yourself!
Using Intellimorph, move the Customer Group column to its new location for the user in the Customer form.
Step by Step
1. Open the Customer Form. 2. Left-click and hold on the column heading for the Customer Group column. 3. Drag the column heading to the first column position of the grid, and release the left-click.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-29
Security
Security Structure
Four items control security in Microsoft Dynamics AX 2009: License codes include the company's purchased features. These license codes enable the whole company access to those areas purchased Configuration keys are used to enable or disable features in the application. These keys control access for the whole company Security keys are assigned to user groups and control access to features within Microsoft Dynamics AX 2009 at a user group level Record level security controls access to records in tables. This means that different user groups can have different access to different records in the same table
License Codes
The first step of configuring Microsoft Dynamics AX 2009 is purchasing and entering license codes into the system. License codes are installed in the Microsoft Dynamics AX 2009 Administration module. Development access is divided into four different licenses: Base Package MorphX Web MorphX X++
Base Package
The Base Package license gives access for creating or modifying reports, jobs, and queries. With the Base Package, the AOT displays the following nodes: Macros Reports Queries Jobs Menus Menu Items System documentation Application Developer Documentation Application documentation
1-30
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
In addition, the Web MorphX license provides access to Microsoft Dynamics AX 2009: Web Projects Web forms Web Page Style Sheet Editor
X++
The X++ license gives access to all classes in Microsoft Dynamics AX 2009 and a development code for the customer layer. It enables customers to put modified objects in the CUS layer, the USR layer, or both. The X++ license is used to modify standard routines, such as the invoice routine or the posting process for a ledger journal. It can also be used to create new business logic if functionality needs to be added to the application.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-31
Each configuration key controls access to a specific feature, and as soon as it is enabled or disabled, the feature is automatically added or removed in the database and in the user interface. The license code determines which configuration keys are available. If the license code for a certain module is not known, the corresponding configuration key does not appear in the list.
1-32
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-33
The virtual company called VLC includes the companies LAU and DMO The corresponding data in the database is identified as belonging to the VLC virtual company in the field DATAAREAID The table collection included in the virtual company is identified as COA or chart of accounts
Security Keys
Security keys are set by User Group and determine the features specific users, as members of those groups, can access. Users can be denied or granted access to complete modules or to specific forms and fields. Security keys are maintained in the Microsoft Dynamics AX 2009 Administration module in the user group permissions form, under the Permissions button on the Permissions tab.
1-34
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Properties within these categories can be set to: No access View Edit Create Full control
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-35
Standard Reports
Standard reports in Microsoft Dynamics AX 2009 contain predefined tables, fields, and layouts. Do not change the table that is used or the fields displayed; however, ranges and sorting can be specified for all fields in the predefined tables.
1-36
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Auto Reports
Auto reports are more flexible than standard reports. In addition to ranges and sorting, there is the ability to: Select which fields to print Define report layouts Define the summation of fields Define criteria for the fields
This figure illustrates the print dialog when creating an auto report.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-37
Simple Inquiry
Opening a standard report or auto report causes the print dialog to appear. The name of the dialog depends on the report. From this print dialog, change the range and sorting by clicking the Select button in the upper-right corner.
1-38
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
This form is divided into three sections: Use the top part of the Inquiry window to select, save, and delete queries Use the center part of the Inquiry window to select which table or tables to use in a report Use the bottom part of the Inquiry window to select range, sorting, and print options
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-39
NOTE: Change the print options from the print dialog screen by clicking the Options button. 5. Click OK.
Advanced Inquiry
Advanced Inquiries involve adding additional tables to reports and creating advanced ranges and sorts on fields in the additional tables.
1-40
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2. Add another row to the bottom part of the inquiry window. 3. Add criteria based on fields in the new tables.
Best Practices
The Developers Best Practice Handbook can be found on MSDN and contains information on the standards, rules, and guidelines that make up the best practices that are used in the development of the Microsoft Dynamics AX 2009 standard application.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-41
1-42
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Challenge Yourself!
From the Customers Form, use the Auto-Report functionality to generate a report for customers that are in customer group 20.
Step by Step
1. Click the Print icon while viewing the Customer form. 2. Click Select on the print dialog. 3. If Customer Group is not a field available in the bottom portion of the inquiry, add this field. 4. Set the criteria of this to only select customers in group 20. If the criteria for customer group 20 are not currently listed in the criteria column, criteria can be added by selecting the list box in the criteria column or just enter the new criteria into the text box of the criteria column for the customer group.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-43
Make sure that the print medium is set to Screen. NOTE: Change the print options from the print dialog screen by clicking the Options button. 5. Click OK.
Summary
This course discussed on a high level, the architecture behind Microsoft Dynamics AX 2009. It introduced important terms regarding the element of Microsoft Dynamics AX 2009 Development, and also looked at the user interface and different ways of having data presented in forms and reports. This course also discussed the basic security architecture that includes License codes, configuration keys, security keys and user groups. The next course examines the Microsoft Dynamics AX 2009 Data Dictionary and related topics.
1-44
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-45
2.
3.
1-46
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Solutions
Test Your Knowledge
1. Where should the Business logic be executed with correctly designed objects? ( ) The Client () The Application Object Server ( ) The Database Server ( ) Stored Procedures on the SQL Server 2. What three items control security within Microsoft Dynamics AX 2009? ( ) Security Keys, Domains and Companies ( ) User Group Permissions, Security Keys, and Layers () License Keys, Configuration Keys and Security Keys ( ) Base Package Keys, X++ Keys, and MorphX Keys 3. Label file ID's that should not be used due to the risk of being overwritten when applying service packs include: ( ) SYS, MBS, USR ( ) SYS, LOS, DIS () GLP, HFX, SL1, SYS ( ) SYP, LOP, DIP, SLP
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
1-47
1-48
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
This chapter introduces the tools and procedures for creating tables, data types, and relations that are required to build the foundation for a simple Customer Birthday module in Microsoft Dynamics AX 2009. In Microsoft Dynamics AX 2009 this is accomplished from the Application Object Tree.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-1
Press CTRL + D.
2-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
NOTE: Microsoft Dynamics AX 2009 objects are exported as .xpo files. These are the only types of files Microsoft Dynamics AX 2009 recognizes when trying to import into the AOT. AOT Right-Click Menu The right-click menu in the AOT differs slightly depending on the node. This section illustrates all the functions of the right-click menu on the top level of the AOT, excluding the Data Dictionary. This figure illustrates a right-click menu on the Tables node. NOTE: The Open New Window command makes it possible to have more than one instance of the AOT open at a time. This makes it simpler to work with multiple objects within the MorphX environment.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-3
2-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Tables
The Microsoft Dynamics AX 2009 database created during installation contains the complete repository. Tables are at the core of the Microsoft Dynamics AX 2009 application and enable storing a company's information and transactions.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-5
Other tables in Microsoft Dynamics AX 2009 contain metadata. These tables contain descriptions of data. This is not data found in a business transaction or business entity such as the ledger table. Metadata is housed in system tables. System tables are differentiated from application tables by the Sys prefix that starts the name of the table. Examples of system and application tables are shown in the following figure.
2-6
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Fields
Access the Fields node using MorphX to create or modify the physical columns in the database table. The fields that are defined within the Fields node are the columns belonging to the physical table named CustTable. CAUTION: Any fields created, deleted, or modified using MorphX in the Table node are reflected in the database. This can potentially damage the Microsoft Dynamics AX 2009 application if not used correctly. Display all the fields for the CustTable by opening the Fields node. The figure below illustrates how MorphX allows for direct viewing of all the columns within a Microsoft Dynamics AX 2009 table.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-7
It is a best practice to use standardized names when field groups are created. These names include the following: Identification Administration Address <module name> (for example Ledger) Setup Dimension Misc
2-8
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
BEST PRACTICES: Define a group when several fields logically belong together and are shown together on forms and reports. Any field that appears in the user interface should belong to a group. The field group named Misc can be used for this purpose. This means that field groups can always be used to design forms.
Indexes
The indexes in the Microsoft Dynamics AX 2009 table definition are the physical indexes that exist on the tables in the database. Indexes speed searching capability and are discussed in more detail later in this chapter. There are two types of indexes: Unique Non-Unique
If a unique index is created based on a column (or a set of columns), Microsoft Dynamics AX 2009 makes sure that no duplicate keys occur in that column (or set of columns). Non-unique, or cluster indexes, are created for performance reasons. They provide a quick way of retrieving data, instead of performing a full-table search of all the records in the table. BEST PRACTICE: Use the suffix Idx when naming indexes.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-9
Under the relations node you can create different types of relationships between the parent table and other tables in Microsoft Dynamics AX 2009. The following figure shows the different types of relationships that exist for CustTable. There are nodes for a variety of different Relations such as BankAccounts and State.
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 table. There are four types of delete actions: None - The row in this table is deleted but nothing occurs to the tables that relate to this table. Cascade - The row in this table is deleted and all data in relating tables is also deleted.
2-10
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
NOTE: Exercise caution when setting up delete actions, as misuse may cause orphaned records.
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. In addition, Microsoft Dynamics AX 2009 uses methods to find open orders and other tasks. Methods are coded using X++. The methods may be modified using MorphX to provide custom functionality.
Creating Tables
Existing tables in Microsoft Dynamics AX 2009 can be modified or new tables may be created using the MorphX tools in the AOT.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-11
2. Rename the table by right-clicking on the table and selecting Rename from the right-click menu. 3. Name the table CustBirthday.Expand the node of the CustBirthday table and view all the categories discussed previously.
2-12
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
b. Rename this field by right-clicking and selecting Rename from the right-click menu and typing birthday. 6. Repeat this process to create two more fields: Enum field: GiftIdeas String field: AccountNumber 7. Figure below illustrates the completed table:
a. Save the table. NOTE: Microsoft Dynamics AX 2009 synchronizes the table when Saving. Synchronizing a table automatically creates or updates it into the underlying database.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-13
2-14
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-15
CAUTION: Improper use of the Table Browser tool may result in corrupted records that may render the company unusable. 1. Open the customer table CustTable and select Table Browser from the Add-Ins menu as shown in the following figure. After selecting the Table Browser, a form opens that contains data from the customer table. Notice that the SQL statement used to obtain the data appears in the lower part of the window as shown in the following figure. 2. Alter the SQL statement manually and re-query the data to change the display results. Also use the standard search options explained in an earlier course, if desired. To sort the data into an ordered manner, access the MorphX menu and select Sort Ascending or Sort Descending. The customer Name data is sorted in an ascending order for viewing purposes. To remove a filter or sort order, use Remove Filter/Sort from the MorphX menu or the toolbar. To view the customer form associated with the customer table, move the pointer into the first column of the table browser window and open the MorphX menu. Select Go to the Main Table Form. The customer form connected to the customer table appears as shown in the following figure. Now, the data within the customer table is successfully browsed and a search performed without leaving the MorphX environment.
2-16
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Challenge Yourself!
1. Create a New Table in Microsoft Dynamics AX 2009 named CompanyHolidays. 2. This table should contain three fields that have appropriate data types and labels: o Field 1: Name of holiday o Field 2: Date of holiday o Field 3: Day of week the holiday falls on NOTE: For this exercise, try to use pre-existing labels if it is possible using the Find Label dialog box. 3. Assign the following Extended Data Types to the appropriate fields: o DateDayName o DatePhysical 4. Name
Step by Step
Solution
Table Creation 1. To create the basic table named Company Holidays right-click the Table node in the AOT and select New Table. 2. After the Table is created, a new Table named Table1 displays. 3. Open the Fields branch and create the fields in the Table. Set up a correspondence for field name, field label, and description: Field Name HolidayName HolidayDate DayName Field Description Name of the Holiday Date of Holiday Name of the Day the Holiday is on Field Label Holiday Date of event Days
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-17
1. To find the appropriate Extended Data Types listed above use the MorphX drop-down menu on the Extended Data Properties. 2. Repeat the process for all the fields.
2-18
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
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. There are many different kinds of referential integrity. A relation may be created on an Extended Data Type in the same manner it is created for a field existing in a table. Relations not only serve to enforce business rules in Microsoft Dynamics AX 2009, they are also used for other important tasks, such as: Creating auto joins in forms. Looking up values in other tables (using lookup list/selection list boxes and the Go to Main Table command). Validating data by providing constraints. Automatically propagate changes from one table to another by defining cascading relations. Generating ToolTips. Auto defining relations in queries.
The customer birthday is an example in which to enforce that only customer account numbers exist in the table, and that vendor numbers are not accidentally input into the customer birthday table. To prevent this, build a relationship between the CustBirthday table and the Microsoft Dynamics AX 2009 customer table named CustTable. This relationship enforces future input to the table and insures that only customers receive gifts.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-19
2. Open the properties sheet for the relation. 3. The Properties sheet shows three properties: Name, Table, and Validate.
4. Name the relation CustomerGifts. Verify that the Validate property is set to Yes. o The Validate property ensures that data in the parent table is checked according to the Relation being constructed.
2-20
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
6. Close the Properties sheet, and then highlight the Relation, and right-click to access the right-click menu.
There are three types of field relationships that can be assigned. Normal relationships enforce referential integrity such as foreign keys. Field fixed works as a trigger to verify that a relation is active. If an enum field in the table has a specific value, then the relation is active. Related field fixed works as a filter on the related table. It only shows records that match a specified value for an enum field on the related table.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-21
g. Open the Properties sheet of the relationship and define the field relations between the fields of the CustBirthday table and the table CustTable. The Field property refers to the assigning table (CustBirthday). The RelatedField property refers to the relating table (CustTable). The following figure shows the completed relationship between fields after closing the properties sheet.
2-22
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Field Name String Integer Real Date Time UTCDateTime Enum Container
GUID
Int64 Boolean
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-23
2-24
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
It is clear from viewing the Properties sheet that Microsoft Dynamics AX 2009 developers have thought of an Extended Data Type for an employee's birthday; but an Extended Data Type for a customer's birthday does not exist. The Extended Data Type BirthDate is an example of basing an extended type on another extended type, because it is based on the Extended Data Type called TransDate. TransDate is also an Extended Data Type based on the primitive type of Date.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-25
2. Rename the new extended data type to Birthday. 3. Open the Properties sheet and find the property called Extends. For the new data type to inherit the behavior from the existing Extended Data Type BirthDate, select BirthDate from the drop-down menu.
2-26
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Now, a new Extended Data Type named Birthday is created that is based on the already existing Extended Data Type BirthDate.
5. Save the new Extended Data Type. o Assign this new Extended Data Type to the Birthday field on the CustBirthday table.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-27
NOTE: Assigning an Extended Data Type to a field on a table causes that field to inherit all the properties of the extended data type. Therefore, this Birthday field has the label Birthday. It is not necessary to assign a label to the field property. 7. Close the Extended Data Type branch, open the Tables branch, and synchronize the database by right-clicking on the Table and selecting Synchronize.
2-28
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The account number in the customer table has an Extended Data Type value named CustAccount. This is the same inheritance that needs to be passed along to the account number in the table that is created.
3. Expand the Fields node within the CustBirthday table. 4. View the properties sheet for the AccountNumber field. 5. Select CustAccount as the value for the Extended Data Type property from the drop-down list. 6. Save the modifications. The AccountNumber field in the customer birthday table is now assigned the CustAccount Extended Data Type.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-29
Base Enums
The base enumeration that describes the status of a customer and or vendor payment is shown in the following figure. The base enumeration defines the status of a customer or vendor payment and the values that can be selected. The status code of Received is shown with its identifying integer value of 5. The identifying integer value is never used for display purposes but serves as the unique Index for the string value of the element. Base enumerations or Base Enums are data types that enable list objects to be created within Microsoft Dynamics AX 2009. The list object is an indexed dropdown menu whose values are specified at design time. These lists can be used as cells within grid objects or as objects resigning independently on a form. Base Enums provide a choice of items from a defined list that may be assigned or modified. For example, a field designating the month that belongs to a transaction should contain twelve months and possibly a null designator. Microsoft Dynamics AX 2009 contains a Base Enum for this purpose.
2-30
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-31
4. View the properties sheet for this element. 5. Set the Name of the element to Idea1 and the Label of the element to Ties. The Name represents a name given to the element on the AOT and its label value is the value presented in the user interface.
6. Create two other elements: one named Idea2 with a label of Watches and the other named Idea3 with a label of Theater Tickets. o Notice how the value of the EnumValue property starts with the value of zero (0) and automatically increments itself by one (1) for every idea added. These EnumValues are how Microsoft Dynamics AX 2009 tracks in the database the enumerated properties being defined.Demonstration: Creating an Extended Data Type That Uses a BaseEnum Now that a base enumeration is created for different gift ideas, assign it an Extended Data Type. 1. Create a new Extended Data Type. 2. Open the Properties sheet for the new object created and give it a name of Gifts and a label Gifts.
2-32
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4. Save the work created and synchronize the object to the database. 5. Now assign the Gifts Extended Data Type to the GiftIdeas field in the customer birthday table. Open the Properties sheet for the GiftIdeas field and assign the ExtendedDataType property the value Gifts.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-33
7. Now, a new base enumeration is created and an Extended Data Type based on it. This new Extended Data Type is also assigned to a field in the customer birthday.
Maps
Maps define X++ elements that wrap table objects at run time. With a map, a map field is associated with a field in one or more tables. This enables to use the same field name to access fields with different names in different tables. Map methods enable to create or modify methods that act on the map fields. A table can be accessed through more than one map. Typically, if more than one map accesses the same table, each map accesses different subsets of fields in the table. Maps do not define database objects and so they are not synchronized with the database.
Maps
An example of a Map is the CustVendTable Map. This map has fields created from existing Extended Data Types. The fields are then mapped to physical data values that exist in Microsoft Dynamics AX 2009 tables through the Mappings node of the Maps branch.
2-34
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The mapping of these fields is performed in the Mapping node of the Map. The table nodes for the mapping are shown in the following figure. Explore some of the actual mappings that exist for the Map fields under the CustTable node. Open the Properties sheet of the AccountNum mapping to reveal its properties. The mapping creates a lookup between the Extended Data Type AccountNum in the CustTable and the AccountNum field that exists in the map. Creating the supporting logic and methods for a map is a subject addressed in a later course.
Views
A Microsoft Dynamics AX 2009 view is a virtual table that provides the data records and fields that are specified by a query. The following sections describe views and how they retrieve data. Like a table, a view uses fields and rows to represent data records. However, the data in a view is not stored as a database object but is dynamically created when the view is accessed. A view uses a query to retrieve data fields from one or more database tables.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-35
Performance
When a view is created, the view definition is generated and stored in the database. When that view is accessed, the view dynamically retrieves the data that satisfies the view definition. NOTE: Views are read-only. The data fields and tables that a view uses cannot be updated from that view. Views are synchronized like tables. When a view is synchronized, the view definition is saved to the database. Synchronization of an existing view causes the definition of that view to be dropped and re-created in the database.
2-36
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3. To create a data source that can be used to construct a View, dragand-drop a data source from the tables node in the AOT. a. Right-click the Tables node in the AOT and select Open New Window. This opens a subset of the AOT that contains only Tables. b. Drag the CustBirthday table from the Tables node in the AOT to the Data Sources node within the Metadata of a View.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-37
5. Create a relation between the data sources so that the data within each Data Source can be joined together. Right-click the relations node of the CustTable Data Source and select New Relation.
2-38
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
7.
Add fields to the view by dragging fields from the Fields node of the Data Sources to the Fields node of the View. o CustBirthday fields: AccountNumber, birthday, Giftideas o CustTable fields: Name, Address, City, State, and ZipCode
8. Perform the same set of actions until all fields are added. o A row of data has been created in the CustBirthday table. This is sufficient for testing of the new View. After closing the Table Browser, save the table so that the data synchronizes to the database.To test the CustBirthdayView, open the View in the Table Browser as we did with the CustBirthday table.Lab Views
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-39
2-40
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Challenge Yourself!
Create a View that will join your new CompanyHoliday table to the Microsoft Dynamics AX 2009 WorkCalendarDate table. From the CompanyHoliday table o o o HolidayName HolidayDate HolidayDayofWeek
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-41
2-42
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Indices
Indices in databases have the same purpose as in a printed book although they are made in another way. An index for a book is a guide to the pages in the book, whereas an index for a table in a database provides a reference to a record or a set of records. There are two types of Indices: unique and non-unique. If a unique index is created based on a certain column, Microsoft Dynamics AX 2009 makes sure that no duplicate key values occur in that column. In the same manner, updates on a column that contain a unique index, which violates the uniqueness of the column, cause an error. Non-unique Indices are created for performance reasons. They provide a quick way of retrieving data, instead of performing a full-table search of all the records in a table. Do not create an indefinite number of Indices because they use system space and must be updated every time system data is created, edited, or deleted. This can slow down the updating process. When an Index is created, it is recommended to give the Index a name reflecting the names of the related fields, followed by the suffix IDX.
Creating Indices
Creating an Index in Microsoft Dynamics AX 2009 always relates to the table where it is created. The Index can only be created on fields that exist in the table. These Indices may be unique or non-unique, and are based on either a single column or multiple columns that exist within the table. NOTE: A field of data type memo or container cannot be used in an index.
NOTE: Microsoft Dynamics AX 2009 requires a unique index on each table so if there are no indexes on a table or all the indexes are disabled, a system index is automatically created. The system index is created on the RecId and DataAreaId fields if the DataAreaId field exists. Otherwise the system index is created on the RecId field. System indexes can be seen in the database but they are not visible in the AOT.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-43
3. Add the GiftIdeas to the index, using the drag-and-drop. Expand the Fields node and drag the GiftIdeas field to the birthdayidx index. o The Index for the CustBirthday based on the field GiftIdeas is now complete and appears on the following AOT.
2-44
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-45
Challenge Yourself!
Create an Index called HolidayDateIdx that will be a Primary Index for the CompanyHoliday table on the field HolidayDate. Set the Primary Index property on the CompanyHoliday table to be the new index HolidayDateIdx.
Step by Step
1. With the CompanyHoliday table open in the AOT, reveal the Indexes branch. Right-click the Indexes node and then select New Index. Rename this to HolidayDateIdx. 2. Set the AllowDuplicates property to No and the Enabled property to Yes. 3. Add the HolidayDate to the index, using the drag-and-drop. Expand the Fields node and drag the HolidayDate field to the HolidayDateIdx index. a. The Index for the CompanyHoliday based on the field HolidayDate is now complete. 4. Select the CompanyHoliday table, right click and select synchronize from the menu. 5. Open the properties for the CompanyHoliday table, and set the property Primary Index to HolidayDateIdx. a. The Primary Index for CompanyHoliday is now complete.
Summary
This chapter discussed the Microsoft Dynamics AX 2009 Data Dictionary and the related objects in the AOT. This chapter also introduced the tools and procedures for creating tables, data types, and relations that are required to build the foundation of any table in Microsoft Dynamics AX 2009. The next chapter examines the User Interfaces in Microsoft Dynamics AX 2009 such as Forms, Menus, and other non-graphical objects.
2-46
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-47
2.
3.
2-48
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Solutions
Test Your Knowledge
1. Task: Put the following steps in order to create a new Primary Index in a table. Step 4 : Add the primary key field(s) to the index Step 3 : Set the Allow Duplicates property on the index to No Step 6 : Set the Primary Index on the Table to the Unique Index Step 1 : Create a new index Step 2 : Set the name for the new index Step 5 : Synchronize the AOT 2. Allowable data types for an index may include: ( ) String, Integer, Real, and Container ( ) String, Enumerated, Real, and Memo () String, Integer, Real, and Enumerated ( ) Memo, Container, Map, and integer 3. Nodes required to define a table include: (Mark all that apply.) (Select all that apply.) () Fields () Field Groups ( ) Maps ( ) Enumerated data types
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2-49
2-50
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
This chapter discusses how to develop the user interface without writing a single line of code. Forms are created to make it possible for the end user to enter and view data. To make navigation easier for the end user, menus and menu items will be created. Different options for obtaining help will be examined. First the Project tool that helps organize the MorphX objects that will be worked will be discussed to help build good development organization and practices.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-1
Projects
Projects organize new or customized application objects. Think of a Project as a reference folder for related objects. The project keeps related objects together in a container to help organize and identify items that are part of a customization or modification. Even though objects can be accessed through projects, they reside in their original location in the AOT. Projects are like a shortcut to application objects.
Creating Projects
Project containers are not visible within the AOT. They are stored in their own object tree. To access projects in Microsoft Dynamics AX 2009, use the Project icon on the toolbar as shown in the Figure.
3-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The project tree is divided into Private and Shared branches: 1. Private - Only visible to the user who created them 2. Shared - Visible to all users of the specific application
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-3
FIGURE 3.3
Forms
Forms are the primary method of interaction between Microsoft Dynamics AX 2009 and a user. An understanding and exploration of existing forms will allow the development of new forms to retain the same look and feel as standard Dynamics AX 2009 forms.
3-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
To examine these categories, open the AOT and locate the CustTable form within the Forms branch of the AOT and expand the CustTable form node as shown in the Figure.
Form Designs
To understand Forms and their design, examine a form at run-time in the application. Some forms can be opened directly from the AOT, whereas other forms rely on information passed to it before they can open. This section works with the CustTable form, which can be opened directly from the AOT.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-5
Notice there is a Data Grid for the tab labeled Overview in the Customer form. This form is composed of nine tab pages, arranged on the top of the form and nine command buttons or button groups arranged at the right side. After viewing the CustTable form, open the Designs branch and compare the objects residing within it versus the Form. Navigate to the Design branch of the CustTable form in the AOT as shown below.
The groups of objects are Tab and ButtonGroup. These are referred to as controls or form controls. To view all the available controls, right-click the Design node and select New Control.
3-6
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The branches of the Design branch show all the controls that belong to the CustTable form; there are eight Tab controls and seven Buttons. The names of the controls and labels displayed on the CustTable form match what appears in the AOT. As a last examination of this design, expand the Tab Page branch labeled Overview under the Tab branch. This reveals all the objects on the first tab page of the customer form. A data grid or Grid control exists with its attached data columns. Later in this section, you design a simple form, learn how to add controls, and assign them to Data Sources.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-7
Open the Data Source for the CustTable form and view its Properties sheet to view which Property values are typically assigned when constructing a Data Source. The Property sheet lists useful Properties for the CustTable data source on the CustTable Form. For example, the AllowCreate and AllowDelete properties control whether new rows can be created or old rows deleted from the customer form. The Table property specifies which table the data source is based on (in this case, the CustTable). The Index Properties controls what index is used for sorting data within the Form. More than a single Data Source can be used on a Form; the linking of data between sources is performed by using the JoinSource Properties. This allows for any level of custom form design. Joining data sources on a form is examined later in this chapter.
3-8
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The init method executes when the form initializes. The close method executes just before the form closes. The ClassDeclaration method is a constructor that defines what classes the form can access. The numberSeqFormHandler method involves calling the class by the same name.
When you create a new form, understanding how to program these methods is not required, Microsoft Dynamics AX 2009 handles them automatically. The custom modification of these methods is beyond the scope of this manual as it involves knowledge of X++ and will be handled in the next class.
Creating Forms
To enter, edit, or delete data in a table from the user interface it must have an accompanying Form. When a new Form is created, MorphX automatically generates a visual layout. Microsoft Dynamics AX 2009 uses the information from its data sources to accomplish this auto-generated layout. In many cases, the system-generated layout is ready to use, but can be modified if it is required. BEST PRACTICES: Use a Project to collect all related development in a central location. This practice will allow the developer to ensure that all components are exported as a unit.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-9
3-10
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Delayed
Active
InnerJoin
OuterJoin
ExistJoin
NotExistJoin
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-11
3-12
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-13
6. Modify the properties of the DateEdit component on the form. Set the DateValue property to date. 7. Use the Find Label dialog to find the label Today and set it as the Label property for the new DateEdit control.
3-14
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Forms Creation
Create a new Form accessing the CustTable table called CustTest. Create a new Form in Microsoft Dynamics AX 2009 that has the following requirements Properties: Uses the customer table CustTable as the Data Source. Use a Tab in your design. Add a Tab Page to your Tab. Use a Grid control as the Tab Page. The following columns should be on your Grid - AccountNumber and Name. Label the Tab Page as Customer Info. Set the Caption Properties of your design to @SYS19920 using the label finder. There is a Properties named TitleDatasource which must be set for the Caption to operate correctly. Set it to your Data Source. Name your new form to CustTest.
The final form when it is compiled and saved should resemble this form:
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-15
Challenge Yourself!
Create a new Form in Microsoft Dynamics AX 2009 that has the following requirements Properties: Uses the customer table CustTable as the Data Source. Use a Tab in your design. Add a Tab Page to your Tab. Use a Grid control as the Tab Page. The following columns should be on your Grid - AccountNumber and Name. Label the Tab Page as Customer Info. Set the Caption Properties of your design to @SYS19920 using the label finder. There is a Properties named TitleDatasource which must be set for the Caption to operate correctly. Set it to your Data Source. Name your new form to CustTest.
3-16
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
FIGURE 3.15
Step by Step
Solution
1. Right-click the Forms node in the AOT and select New Form. 2. Right-click the NewForm1 and Rename it CustTest. 3. Expand the CustTest form node and right-click Data Sources and select New Data Source. 4. Right-click DataSource1 and select Properties to open the Properties sheet. 5. Set the Table Properties to CustTable. Close the Properties sheet. 6. Expand the Designs node, right-click the Design branch, and select New Control and Tab. 7. Right-click the Tab branch and select New Control and TabPage. 8. Expand the Tab branch, right-click TabPage:TabPage, and select New Control and Grid. 9. Right-click the Grid: Grid branch and select New Control and StringEdit. 10. Repeat step 9 to create a second field. 11. Right-click the StringEdit:StringEdit branch and select Properties to open the Properties sheet. Set the DataSource property to DataSouce1 and the DataField property to AccountNum. 12. Right-click the StringEdit1:StringEdit1 branch and select Properties to open the Properties sheet. Set the DataSource property to DataSuouce1 and the DataField property to Name.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-17
3-18
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
There are three types of menu items that can be created: Display Output Action
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-19
3-20
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
There are two important Properties to notice. Class property = Form Object property = CustTable
The Class property sets the class of item that appears, whereas the Object property is the name of the object itself. When you open the menu item, a form named CustTable opens.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-21
FIGURE 3.18
The new menu item is now available to be added to a new or existing menu.
3-22
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The figure illustrates the form that enables the outputting of the Customer Turnover report (CustRevenue).
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-23
There are two important properties to notice. Class property = Class Object property = CustReport_Revenue
The CustRevenue Output Menu Item directly calls the class named CustReport_Revenue.
3-24
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The property sheet of an action menu item is structurally identical to an Output menu item.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-25
The Cust menu in the AOT represents the accounts receivable menu. Recall this menu is a part of a larger menu, the MainMenu. To understand how these menu objects interact, expand the Menus node in the AOT as shown in the following figure.
3-26
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The small arrow on the folder indicates that these are menu references for the Microsoft Dynamics AX 2009 Navigation Pane. If you view the properties for the Accounts receivable menu reference in the MainMenu, note the object name of the menu is Cust. The menu reference points to the Cust menu. Locate the Cust menu and open its node. Notice you are viewing the objects that are seen from the Accounts receivable menu of Microsoft DynamicsAX 2009. The Cust menu consists of the following submenus: Journals Inquiries Reports Periodic Setup
The visible menu items shown within the parent menu are as follows: Sales order Free Text Invoice Customers
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-27
2. Assign the MenuItemName property ZipMenuItem. The properties associated with ZipMenuItem such as Label and Object Properties are inherited. 3. To test the menu item highlight it and open it. Verify it contains the ZipCodes form. A quicker alternative for adding a menu item to an existing menu is using the drag and drop functionality in MorphX. Drag the menu item onto the specified menu.
3-28
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-29
Places
Places is a new functionality in Dynamics AX 2009 located within the Navigation Pane. The Places section contains an Area Page link and links to Menu Items that have been appropriately designed. Clicking on a Menu Item other than the Area Page, in the Places section of the Navigation Pane will launch that Menu Item as either a List Page or as a Single Document Interface (SDI) form.
3-30
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
NOTE: Single Document Interface (SDI) forms are one of the biggest changes to the user interface in Dynamics AX 2009. In previous versions of Dynamics AX 2009 all forms were Multi-Document Interface (MDI) forms. The advantage of SDI forms is that they located outside of the Content Frame as a separate Window.
Forms
Forms is a new section within the Navigation Pane that contains links to all other Menu Items that are not set to be displayed in Places.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-31
The Area Page can be used as an alternate means of navigating through the system as it displays all of the forms that are listed within the Navigation Pane. The Area Page cannot be developed. It is generated by Dynamics AX 2009 using the structure of the menu that is displayed. An Area Page and its link will be created automatically whenever a new menu is created in the AOT. NOTE: List Pages are a new type of form that will display read-only lists within the Content Frame. List Pages are beyond the scope of this course, and are addressed in a more advanced course.
3-32
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Your completed menu item, when it is opened, contains the CustTest form.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-33
Challenge Yourself!
Requirements of this exercise are the completion of a new menu item with the following Properties: Menu Item opens the CustTest form that you created in the previous exercise Select the appropriate type of menu item Select the correct object class and object Name and label the new menu item CustTest Put the new menu item on the Accounts Receivable menu, located below the Customers form
Your completed menu item, when it is opened, contains the CustTest form.
Step by Step
Solution
1. Expand the Menu Items node in the AOT. Right-click the Display node, and select New Menu Item. 2. Open the Property sheep and set the Class property to Form. 3. Set the Object property to CustTest. 4. Set the Name and Label Properties to CustTest. 5. Right-click the CustTest branch under the Display node and select Save. 6. Right-click the CustTest branch under the Display node and select Open. 7. Your CustTest Form should open. 8. In the AOT, expand the Menus node and locate the Cust menu and expand. Right-click the Cust menu and select New then Menu item. 9. Open the properties for the new menu item. The MenuItemType should be Display and the MenuItemName should be CustTest. 10. Position the new CustTest menu item below the Customers menu item. 11. When you now open the Navigation Pane your CustTest menu should be available in Accounts Receivable.
3-34
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Classes
Classes have the following characteristics: Classes allow reuse common functionality or business logic. Classes are a design or blueprint for a programming object. After a set of Classes is defined, they can be used programmatically from all the other application objects. Classes can be run directly from the AOT if a Main method is defined, although this is not a common practice. Classes are used for solving tasks for other application objects, such as forms and reports. Classes in Microsoft Dynamics AX 2009 share the same attributes a class in C# has, such as inheritance, polymorphism, and encapsulation.
You may be tempted to start with coding as the first step. This approach is not ideal in a Microsoft Dynamics AX 2009 application because code runs in the context of an application object and an associated event. A class contains all the properties, methods, and variables needed by an object. A class can be created by right-clicking the Classes node of the AOT, and selecting New class or by using the Class Wizard located in the Tools menu.
Class Methods
When developing a class it contains three nodes by default: The Class Declaration node specifies the name of the class and the necessary variables. It can also specify inheritance.
NOTE: Class Declaration is not a method. It is a class-level scope area that defines global variables for all methods within the class.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-35
Classes are covered in detail in the course Development II: Introduction to X++, and are beyond the scope of this tutorial on MorphX.
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. They serve in the same manner a header file might serve for data structure definition, because they provide definition values of Properties associated to an object. An example of a Macro is a File macro. The File macro provides: Definitions of file extensions Input/Output definitions XML file definition Delimiter information
A sample of a macro named File is shown in the following figure that describes file extensions. File extensions are definitions for objects in Microsoft Dynamics AX 2009 that must use files. This macro enables file extensions to be defined in a single central location, where all file aware classes can have use of it.
The macros node in the AOT contains macros used by the standard application. Here are some key points of macros. They can be declared wherever you can write X++ statements and contain code that can be useful in several places. An advantage of defining a macro is that the maintenance is done in only one place. A macro cannot run independently, but can be used anywhere you can write code in the system, such as in jobs, classes, and forms.
3-36
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
All types of packaging have identical syntax and functionality. The differences between the packaging are: A standalone macro is created by using the macro node of the AOT. A local macro is declared within a method or stand-alone macro. A macro library is a standalone macro that contains a collection of local macros.
Generally, define a class instead of writing macros for work involving statement logic. Macros are covered more in detail in advanced classes in X++ and MorphX development.
Jobs
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 2009. The jobs node on the AOT is empty after installing and configuring the Microsoft Dynamics application. These batch jobs can be scheduled to run at specific times.
Create a new job by selecting New Job when right-clicking on the Jobs node in the AOT. The Job skeleton named Job1 is created. Use the Edit method from the MorphX right-click menu to create new X++ code you can test or modify existing code within a job.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-37
Jobs have the following characteristics: When testing new code, jobs save development time by eliminating creating a new class and defining a new method. A job is a static method that returns nothing and can be attached to a form for testing. They are primarily used in the production environment only to run batch work in the background.
Microsoft Dynamics AX 2009 includes several batch processes already a part of the system. Jobs are discussed in Development II.
Queries
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, or another query. The query extracts data from a database and presents it in a form for viewing. Although the query does not provide a graphical viewing interface, Microsoft Dynamics AX 2009 provides a specialized form named a query dialog form.
3-38
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The Asset Proposal query uses the AssetBook and AssetTable tables as its data source. Basic components of a query are composed of: Methods Data Sources
Data sources have their own field objects and methods such as sorting. A query resembles a view except it is not static because it can be modified at run time. Often, queries are used behind the scenes and are never viewed by the user. This is the case when X++ based queries set the position of a data source on a form. Query objects that are created in the AOT can be viewed by using the query dialog form. The query dialog form in this section is a system form named SysQueryForm. The SysQueryForm is the standard form used by Microsoft Dynamics AX 2009 for presenting graphical dialog boxes that enable the design and modification of queries by the end user. To show how the query is linked to the SysQueryForm, view the properties sheet of the AssetProposal query. Open the Asset Proposal query so for analysis in the query dialog form.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-39
The query dialog shown in the proceeding figure is the result of the query design.
3-40
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The Data Sources branch refers to tables that are used by the query; Ranges refers to the fields available to the query dialog form. The data sources and Relations objects together form all the possible fields available to the query. Fields in the Ranges branches appear in the query Dialog design form when it opens. The design of a query at runtime is a temporary change that is not stored after the design change occurs. The user can add different tables, table joins, fields, field criteria, and have their custom design run one time.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-41
4. Open the query to view its results. Set the criteria field for GiftIdea. 5. Set the Criteria property to the value of Theater Tickets using the drop-down menu on the query dialog form. The Customer Tickets query is finished and can be used in a report that shows customers who wants theater tickets as a gift.
Help Documentation
Microsoft Dynamics AX 2009 2009 includes a Help system that is based on Compiled HTML Help files (chm files). The Help system can be accessed from Microsoft Dynamics AX 2009 to provide assistance with the application; however, it is also available from outside the application. The help system is spilt into several files to reflect the job roles associated with Microsoft Dynamics AX 2009. Each Help file is editable by using a Chm file tool such as HTML Help Workshop. The same tool can be used for creating new Help files for Partner Solutions. Chm files do not have to be indexed or initialized during installation. This can save time. The Help files are continuously updated and made available for download.
3-42
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Application Documentation
The Microsoft Dynamics AX 2009 application documentation is located under the Application documentation node and contains reference documentation for the Microsoft Dynamics AX 2009 application. Documentation is also available on forms in the application.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-43
NOTE: You can check if there is an updated version of the Help file. Just click Check for Updates on the Help menu. You can also check this site for more information: http://www.microsoft.com/dynamics/ax/using/default.mspx
Summary
This course discussed how to develop the user interface without writing a single line of code. This course also made it possible for end users to enter and view information using Forms that were created. To make navigation easier for the end user, menus and menu items were created. Different options for obtaining help were examined. Tools such as the Project Tool were reviewed to help organize the MorphX objects that were worked upon. The next course examines the Report functionality in Microsoft Dynamics AX 2009.
3-44
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-45
2.
3.
3-46
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Solutions
Test Your Knowledge
1. The three (3) elements for a Form include: ( ) Methods, Data Sources, and Views () Designs, Methods, and Data Sources ( ) Display Menu Items, Data Sources, and Designs ( ) Jobs, Menu Items, and Macros 2. The Area Pages can be customized by: ( ) Making changes to the Areas node in the AOT () By making changes to the Menus that the Areas page will automatically be generated from ( ) By setting the IsDisplayedInContentArea property of the Navigation Pane ( ) The Area Pages cannot be changed 3. Available Project types available are: Mark all that apply. (Select all that apply.) () Project ( ) Help Project () SysTestProject ( ) Test Project 4. Available Menu Items are: Mark all that apply. (Select all that apply.) () Display Menu Items () Output Menu Items ( ) Project Menu Items ( ) Report Menu Items
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
3-47
3-48
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
A report presents information from a database as a printed document. Use reports to print invoices or complex summaries. All reports in Microsoft Dynamics AX 2009 are located in the AOT, where report elements can be accessed and adjusted. Several tools are designed to help perform adjustment tasks. MorphX helps to design reports that present information by using a graphical tool named the Visual Report Designer. This tool can combine many different design elements into one report, such as: Labels Data from the database Lines Graphics
The Visual Report Designer is located under the reports node in the AOT. The Visual Report Designer will be reviewed first, followed by the two types of report designs Auto Design and Generated Design. Lastly, reusable templates will be examined for both reports and sections. See the Appendix topic, "Case Study".
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-1
4-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Use this to override the default value and specify the number of columns viewed on the report. By clicking the toggle button again, it returns to the default value.
3. Add a field to the body of the report by right-clicking in the body and selecting New. There are several options available, but for now focus on the option Field from CustTable. 4. Select this option to display the list of fields from the data source.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-3
NOTE: Learning best practices means to become aware of all the things to do, and then being able to distinguish which of these can be realistically accomplished.
4-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Report Design
A report in the AOT resembles a form. They both contain Methods, Data sources, and Designs. An important difference is that the data source element in reports consists of a query not a table. Microsoft Dynamics AX 2009 enables reports to have designs generated automatically so that the developer does not have to specify a report layout. The design of a report is controlled from the Designs node. Within the Designs node there are two types of design specifications: AutoDesignSpecs GeneratedDesign
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-5
NOTE: Instead of using a table in the report datasource, a Query may also be used by dragging and dropping the Query from the AOT to the Report Datasource. Now a Design for MyReport must be created. 1. Right-click the Designs node and select New Report Design. 2. Expand the ReportDesign1 node to reveal the AutoDesignSpecs node. Right-click this node and select Generate Specs From Query. The nodes created under this one correspond to the tables within the query. 3. Add fields to these groups in the design. On the CustTable_Body node, right-click and select the new control Field from CustTable. Drag the AccountNum, Name, and Address fields onto this node. 4. Repeat this process for the CustTrans_Body node by using the new control Field from CustTrans to add TransDate, Voucher and AmountMST. 5. Save the report.
4-6
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
This is the recommended method to use if a specific format and look is required.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-7
FIGURE 4.5
4-8
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-9
4-10
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-11
FIGURE 4.7
Report Templates
When designing reports, the option is available to work from several templates in the standard Microsoft Dynamics AX 2009 application or to create a new template. When applying a template to a report design, several layout elements built into the template are automatically received. A template can include the following: Page numbers on each page A specific company logo A specific disclaimer required for all reports
If reports share the same template, apply changes to the report template. The changes are inherited by the reports using this template. Inheritance of report elements is a significant advantage for report design because many elements of a report are repetitive. Using a report template eliminates redesigning report sections as headers, disclaimers, and other typically used elements.
4-12
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
7. Save the method and close the Code Editor. 8. To view the value returned from the display method, attach the method to the CompanyName control on the Prolog by assigning the DataMethod property the value of CompanyName. 9. Because this is on the front of the report, make the font size of this control larger. Set the FontSize property to 20.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-13
Section Templates
Section Templates make it possible to define sections one time and reuse them many times. Typically this is used for elements appearing in more than one report. For example, a customer wants to customize the layout of all checks printed from Microsoft Dynamics AX 2009. Instead of changing all the reports that print a check, change only the check section template.
4-14
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Paper Format
When running a report in Microsoft Dynamics AX 2009, the paper format must be specified for each report type. For example, open the Accounts Receivable module, then Setup, then Forms, and open Form setup. On the Packing slip tab, in the Layout section, view an example of where the Paper format can be specified. Microsoft Dynamics AX 2009 reports use three standard paper formats: Blank Paper - This is used when nothing is pre-printed on the paper for the report. This choice gives the user a Header, optionally a logo, and all system labels assigned to the printed system data. Partly preprinted or Semi preprinted - This is used for paper without a header. This choice gives the user no Header, but gives all system labels assigned to the printed system data. Preprinted - This option is used if the user does not want anything except the system data printed on the report. This choice gives the user no Header and no labels.
Summary
This course discussed the Microsoft Dynamics AX 2009 techniques for generating a report from the database as a printed document. The location in the AOT of all reports is shown to allow access to adjust and create report elements. This course also discussed tools such as the Visual Report Designer, Templates and MorphX which are used to allow adjustments of report layouts.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-15
2. contain which items? Mark all that apply. (Select all that apply.) ( ) Bodies ( ) Footers ( ) Headers ( ) Page Footers What are some features of the Visual Report Designer that make it an ideal choice for designing reports?
4-16
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
2.
3.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
4-17
Solutions
Test Your Knowledge
1. What are the three major components that constitute a Microsoft Dynamics AX 2009 report? Mark all that apply. (Select all that apply.) () Designs () Datasources () Methods ( ) Layouts 2. What is the difference between an AutoDesign specification and a custom GeneratedDesign specification? MODEL ANSWER - When you are using AutoDesignSpecs, the report layout is generated when the report is run. Its content and layout are based on the query used for the report. In a GeneratedDesign the layout is dictated by its design structure that is created in the Visual Report Designer and not by a query or report template. 3. A Section group can contain which items? Mark all that apply. (Select all that apply.) () Bodies () Footers () Headers ( ) Page Footers 4. What are some features of the Visual Report Designer that make it an ideal choice for designing reports? MODEL ANSWER - The Visual Report Designer allows you to drag and drop report field elements for placement in the report. It allows you to change the scaling while in design mode so you can place your objects more accurately.
4-18
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Introduction
The Contoso Entertainment Systems has been operating and providing outstanding service to its customers for over 50 years. Recently, customer communication issues have arisen in the Accounts Receivable Department. Customers have complained that the level of service they receive from the Contoso Entertainment Systems Company has not been satisfactory. The department manager has decided the best way to handle this problem is to create a customer contact log. By keeping a log, the manager feels that customer service will improve. As a Microsoft Dynamics AX 2009 developer for the Contoso Entertainment Systems, it is your responsibility to add this functionality to Microsoft Dynamics AX 2009. The goal of the case study is to create an application called the Customer Contact log. The log will track the medium used to contact the customer, such as e-mail, telephone, or mail, and last contact date, and a note about the issue. The Contoso Entertainment Systems Company hopes that by keeping this log, customer communication will no longer be an issue.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-1
Metadata Design
In Part 1, create the basic metadata design necessary for the Customer Contact log.
Creating metadata involves building data dictionaries that define entity relationships, primary and foreign key relations, and the assignment of data types. Accomplish the metadata design, using familiarity with the CustTable table, by creating a single new table within the Microsoft Dynamics AX 2009 Data Dictionary.
A-2
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
The table holds non-duplicated information about all contacts made by Customer Service Representatives. The form you create shows the data from the new table and serves as the graphical user interface for entering and displaying information about all customer contacts made by Customer Service Representatives.
An Extended Data Type for ContactType is not apparent using the existing data types. Enter Custom into the table as a place holder to later build an extended data type for the ContactType field.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-3
Create a Project
Create a project to store all the application objects that are created throughout this project. Projects are an important organizational tool when developing in Microsoft Dynamics. Create one here to store all the application objects. 1. Open the Projects tree from the icon on the toolbar and expand the Private node. 2. Right-click the Private node and select NEW -> PROJECT. Rename the project CustContactLogProject. After creating an object in the AOT during this Case Study, drag it from the AOT and drop it on the project node. In this manner, when modifying the customization later, it is easier to find all the relevant application objects. This action creates a link to the object in the AOT.
A-4
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
7. Save the ContactMethods base enumeration. 8. Next, create an extended data type for the ContactMethods base enumeration that can be assigned to the ContactType field.
Table Creation
1. Start with creating the table. Open the Tables branch and select the New Table method. Rename the table CustContactLog. 2. Create a String field named AccountNumber. Give this field an extended data type of AccountNum. 3. Create a String field named ContactName. Give this field an extended data type of Name. 4. Create a Date field named ContactDate. Give this field an extended data type of DatePhysical. 5. Create an Enum field named ContactType. Assign this field the ContactTypes extended data type created in the previous exercise. 6. The last field to create is the ContactNotes field. Assign this field the Notes extended data type.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-5
NOTE: To understand more about Memo data types consult the Microsoft Dynamics AX 2009 Developer Help.
A-6
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
5. To test that the table is created correctly, view the table in the Table Browser. Review the section titled Viewing and Searching Data in Microsoft Dynamics AX 2009 Tables in Course 2 for more information.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-7
A-8
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-9
Now that the data sources for this report are added, create the design. 1. First, right-click the Design node of the report and select New Report Design. 2. Expand the ReportDesign1 node to reveal the AutoDesignSpecs node. Right-click and select Generate Specs from Query. This adds two Body sections to the design, one for each data source in the query. 3. Add the fields shown in the following figure to each of the Body sections.
A-10
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-11
3. The final step is to add the CustomerService menu as a reference on the main menu. Right-click the MainMenu menu in the AOT and select NEWMENU REFERENCE. 4. Drag the CustomerService menu reference onto the MainMenu. 5. To view the changes to the navigation pane, close and reopen the navigation pane. Reopen the navigation pane using the icon on the toolbar shown in the following figure.
6. The Customer Contact Log project is now completed, and is ready for use.
A-12
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
Summary
This Case Study did a walk-through of how to develop a full project without needing to write a single line of code. The first part of the Case Study reviewed the tasks required to define the Metadata for the rest of the case study. The second part of the Case Study reviewed the steps required to build the data dictionary objects necessary to store information for the customer contact log that was created. The last part of this case study reviewed the steps required to build the customer contact log graphical interface, including forms, menu items, and menus developed using MorphX.
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement
A-13
2.
3.
A-14
Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement