Home > Sample chapters

The MorphX Development Environment and Tools

Application Object Tree

The AOT is the main entry point to MorphX and the repository explorer for all metadata. You can open the AOT by clicking the AOT icon on the toolbar or by pressing Ctrl+D. The AOT icon looks like this:

021fig01.jpg

Navigating through the AOT

As the name implies, the AOT is a tree view. The root of the AOT contains the element categories, such as Classes, Tables, and Forms. Some elements are grouped into subcategories to provide a better structure. For example, Tables, Maps, Views, and Extended Data Types are located under Data Dictionary, and all web-related elements are located under Web. Figure 2-2 shows the AOT.

FIGURE 2-2

FIGURE 2-2 The AOT.

You can navigate through the AOT by using the arrow keys on the keyboard. Pressing the Right Arrow key expands a node if it has any children.

Elements are arranged alphabetically. Because there are thousands of elements, it’s important to understand the naming conventions and adhere to them to use the AOT effectively.

All element names in the AOT use the following structure:

  • <Business area name> + <Functional area> + <Functionality, action performed, or type of content>

With this naming convention, similar elements are placed next to each other. The business area name is also often referred to as the prefix. Prefixes are commonly used to indicate the team responsible for an element. For example, in the name VendPaymReconciliationImport, the prefix Vend is an abbreviation of the business area name (Vendor), PaymReconciliation describes the functional area (payment reconciliation), and Import lists the action performed (import). The name CustPaymReconciliationImport describes a similar functional area and action for the Customer business area.

Table 2-2 contains a list of the most common prefixes and their descriptions.

TABLE 2-2 Common prefixes.

Prefix

Description

Ax

Microsoft Dynamics AX typed data source

Axd

Microsoft Dynamics AX business document

Asset

Asset management

BOM

Bill of material

COS

Cost accounting

Cust

Customer

Dir

Directory, global address book

EcoRes

Economic resources

HRM/HCM

Human resources

Invent

Inventory management

JMG

Shop floor control

KM

Knowledge management

Ledger

General ledger

PBA

Product builder

Prod

Production

Proj

Project

Purch

Purchase

Req

Requirements

Sales

Sales

SMA

Service management

SMM

Sales and marketing management, also called customer relationship management (CRM)

Sys

Application frameworks and development tools

Tax

Tax engine

Vend

Vendor

Web

Web framework

WMS

Warehouse management

Projects, described in detail later in this chapter, provide an alternative view of the information in the AOT.

Creating elements in the AOT

You can create new elements in the AOT by right-clicking the element category node and selecting New <Element Type>, as shown in Figure 2-3.

FIGURE 2-3

FIGURE 2-3 Creating a new element in the AOT.

Elements are given automatically generated names when they are created. However, you should replace the default names with new names that conform to the naming convention.

Modifying elements in the AOT

Each node in the AOT has a set of properties and either subnodes or X++ code. You can use the property sheet (shown in Figure 2-9, later in this chapter) to inspect or modify properties, and you can use the X++ code editor (shown in Figure 2-11, later in this chapter) to inspect or modify X++ code.

The order of the subnodes can play a role in the semantics of the element. For example, the tabs on a form appear in the order in which they are listed in the AOT. You can change the order of nodes by selecting a node and pressing the Alt key while pressing the Up Arrow or Down Arrow key.

A red vertical line next to a root element name marks it as modified and unsaved, or dirty, as shown in Figure 2-4.

FIGURE 2-4

FIGURE 2-4 A dirty element in the AOT, indicated by a vertical line next to the top-level node, AccountingDistribution.

A dirty element is saved in the following situations:

  • When the element is executed.
  • When the developer explicitly invokes the Save or Save All action.
  • When autosave takes place. You specify the frequency of autosave in the Options form, which is accessible from the Tools menu.

Refreshing elements in the AOT

If several developers modify elements simultaneously in the same installation of AX 2012, each developer’s local elements might not be synchronized with the latest version. To ensure that the local versions of remotely changed elements are updated, an autorefresh thread runs in the background. This autorefresh functionality eventually updates all changes, but you might want to force the refresh of an element explicitly. You do this by right-clicking the element, and then clicking Restore. This action refreshes both the on-disk and the in-memory versions of the element.

Typically, the general integrity of what’s shown in the AOT is managed automatically, but some operations, such as restoring the application database or reinstalling the application, can lead to inconsistencies that require manual resolution to ensure that the latest elements are used. To perform manual resolution, follow these steps:

  1. Close the AX 2012 client to clear any in-memory elements.
  2. Stop the Microsoft Dynamics Server service on the Application Object Server (AOS) to clear any in-memory elements.
  3. Delete the application element cache files (*.auc) from the Local Application Data folder (located in %LocalAppData%) to remove the on-disk elements.

Element actions in the AOT

Each node in the AOT contains a set of available actions. You can access these actions from the context menu, which you can open by right-clicking any node.

Here are two facts to remember about actions:

  • The actions that are available depend on the type of node you select.
  • You can select multiple nodes and perform actions simultaneously on all the nodes selected.

A frequently used action is Open New Window, which is available for all nodes. It opens a new AOT window with the current node as the root. This action was used to create the screen capture of the AccountingDistribution element shown earlier in Figure 2-4. After you open a new AOT window, you can drag elements into the nodes, saving time and effort when you’re developing an application.

You can extend the list of available actions on the context menu. You can create custom actions for any element in the AOT by using the features provided by MorphX. In fact, all actions listed on the Add-Ins submenu are implemented in MorphX by using X++ and the MorphX tools.

You can enlist a class as a new add-in by following this procedure:

  1. Create a new menu item and give it a meaningful name, a label, and Help text.
  2. Set the menu item’s Object Type property to Class.
  3. Set the menu item’s Object property to the name of the class to be invoked by the add-in.
  4. Drag the menu item to the SysContextMenu menu.
  5. If you want the action to be available only for certain nodes, modify the verifyItem method on the SysContextMenu class.

Element layers and models in the AOT

When you modify an element from a lower layer, a copy of the element is placed in the current layer and the current model. All elements in the current layer appear in bold type (as shown in Figure 2-5), which makes it easy to recognize changes. For a description of the layer technology, see the “Layers” section in Chapter 21, “Application models.”

FIGURE 2-5

FIGURE 2-5 An element in the AOT that exists in several layers.

You can use the Application object layer and Application object model settings in the Options form to personalize the information shown after the element name in the AOT (see Figure 2-1, shown earlier). Figure 2-5 shows a class with the Show All Layers option set. As you can see, each method is suffixed with information about the layers in which it is defined, such as SYS, VAR, and USR. If an element exists in several layers, you can right-click it and then click Layers to access its versions from lower layers. It is highly recommended that you use the Show All Layers setting during code upgrade because it provides a visual representation of the layer dimension directly in the AOT.

Related resources

There are currently no related titles.