The MorphX Development Environment and Tools

  • 8/11/2014

Cross-Reference tool

The concept of cross-references in AX 2012 is simple. If an element uses another element, the reference is recorded. With cross-references, you can determine which elements a particular element uses and which elements other elements are using. AX 2012 provides the Cross-Reference tool for accessing and managing cross-reference information.

Here are a couple of typical scenarios for using the Cross-Reference tool:

  • You want to find usage examples. If the product documentation doesn’t help, you can use the Cross-Reference tool to find real implementation examples.
  • You need to perform an impact analysis. If you’re changing an element, you need to know which other elements are affected by your change.

You must update the Cross-Reference tool regularly to ensure accuracy. The update typically takes several hours. The footprint in a database is about 1.5 gigabytes (GB) for a standard application.

To update the Cross-Reference tool, on the Tools menu, point to > Cross-Reference > Periodic > Update. Updating the Cross-Reference tool also compiles the entire AOT because the compiler emits cross-reference information.

In addition to the main cross-reference information, two smaller cross-reference subsystems exist:

  • Data model Stores information about relationships between tables. It is primarily used by the query form and the Reverse Engineering tool.
  • Type hierarchy Stores information about class and data type inheritance.

For more information about these subsystems and the tools that rely on them, see the AX 2012 SDK (http://msdn.microsoft.com/en-us/library/aa496079.aspx).

The information that the Cross-Reference tool collects is quite comprehensive. You can find a complete list of cross-referenced elements by opening the AOT, expanding the System Documentation node, and clicking Enums and then xRefKind. When the Cross-Reference tool is updating, it scans all metadata and X++ code for references to elements of the kinds listed in the xRefKind subnode.

To access usage information, right-click any element in the AOT and point to Add-Ins > Cross-Reference > Used By. If the option isn’t available, either the element isn’t used or the cross-reference hasn’t been updated.

Figure 2-31 shows where the prompt method is used on the RunBaseBatch class.

FIGURE 2-31

FIGURE 2-31 The Cross-Reference tool, showing where RunBaseBatch.prompt is used.

When you view cross-references for a class method, the Application hierarchy tree is visible, so that you can see whether the same method is used on a parent or subclass. For types that don’t support inheritance, the Application hierarchy tree is hidden.

Related resources

There are currently no related titles.