Professional Documents
Culture Documents
Introduction
OUTLINE
Version 3.0 of Dynamics AX (Formerly Axapta) introduced AOT views; these allow you to
define custom views of your Dynamics AX data; typically, these span more than one table
and have the effect of “flattening out” complex relationships between tables and making the
view appear as a table in its own right.
This document describes how you can use the AOT to build a view for yourself and how you
then make it available for use with Atlas xl.
Open the Views node in the AOT and create a new view
Add in the tables you wish to include as data sources for your view. For
example LedgerTable and LedgerTrans
Add fields to the Auto-report and Auto-lookup field groups. These fields
must be from the fields node in the view
Getting started
CREATING A NEW VIEW IN THE AOT
Simply open the AOT and navigate to and open the Data Dictionary node. From
here select the Views node. Use the right-click on your mouse to select New
View or use File -> New -> New from the pull down menu to create a new view.
When you have done this, a view will be created in the AOT with a name of
View1 as can be seen here:
A description for the view, sourced from a label file or typed in directly
Here you can see that the new view has been named “Atlasxl_TutorialNewView”
and has a description of “Ledger Transactions – Tutorial”.
Tables are added to the Metadata node of the view. Open the new view by
clicking on the + button. To add a new table:
Click to select the Metadata node and expand this by clicking the +
button
Select the Data Sources node and then use right-click to open the action
menu.
The first Data Source in the AOT is automatically chosen for you, select
this and then use the right-click to open the properties form.
Using the properties form, use the Table entry box to choose the table
you want to use with the view. E.g. LedgerTable
You achieve the same thing by using the drag and drop method. Simply open
the Tables node of the AOT in another window, find the table you want to use
and then drag and drop it onto the Data Source node of the new view.
To add additional tables, expand the table node to reveal another Data Source
node; select it and repeat the steps above. In the following example you can see
that LedgerTrans has been added to the view. You should note that this
structure adds tables in a parent to child relationship:
Having added two or more tables to the Metadata structure, you must tell
Dynamics AX how these tables are related. You do this by defining the linking
fields between the parent and child tables.
To add a relationship:
Click to select the child table node and expand this by clicking the +
button
Select the Relations node and then use right-click to open the action
menu.
Dynamics AX attempts to define the links between the two tables but it is
advisable to check this as this is often incorrect. Select the relationship
and then use the right-click to open the properties form.
Using the properties form, change the field and related field entries to
suit. In the case of ledgerTable and LedgerTrans, the joining field is
AccountNum.
Ranges allow you to pre-set a filter on the view; for example you might want a
view to return rows that include revenue accounts only. Ranges apply to the
fields of the data sources in your view and can be a useful way to limit the
volume of records returned. To add a range or filter:
Click to select the data source from which you want to select a field
Select the Ranges node and then use right-click to open the action menu
The first field in the table will be selected automatically, use the right-
click option to edit the properties of this field
From the properties window, select the field you want to use if this is not
the field you need and then enter the value of the filter you want to
apply. Do this in the Value entry box
Choose the Status entry box to hide the filter from the view
At this stage, the view is simply a collection of tables; you can add fields to the
view by selecting them from the data sources you have already included. Simply
select a field or fields from the data source and drag-and-drop them into the
fields node of the view.
You can achieve the same thing by selecting the Fields node and then using
right-click New View Field option.
Since the field list in the data source table is often long, it is a good idea to open
the fields of the data source in a new window. Position the cursor in the list and
then drag-and-drop fields. Here you can see that the view fields are Account
number, Account name, Amount, secondary amount, dimension and transaction
date:
It should be noted that the Account number and name are sourced from the LedgerTable
and not LedgerTrans like the rest of the fields.
FIELD GROUPS
Views support field groups. You can define your own groups or you can choose
to use the predefined AutoReport and AutoLookup groups. If you are using these
views with Atlas xl we recommend that you use these two groups as they are
used in the transaction drill down form.
Using the fields from the View Field list, drag-and-drop the ones you want to use
with each group. Include all fields as an easy way to set up these groups.
Here you can see AutoReport has all fields from the view:
Add this to the Atlas supported tables list for it to be available for use with your
Atlas xl reports. Here you can see how this view is used in a AX Balance
formula:
Suggested enhancements
AGGREGATION OF NUMERIC FIELDS
A useful feature of a view is that you can aggregate amounts around a set of
predefined aggregation types. Normally, the SUM type is the most commonly
used. After selecting the fields for the view, if you want to aggregate any
numeric fields, simply:
Open the Fields node to reveal a list of fields for the view
Select the numeric field that you want to apply aggregation too
The effect of this is to summarise or aggregate the view by the amount filed
selected. Instead of showing transactions, the view is aggregated according all
the fields in it. The more fields the less the level of aggregation.
In the example here, both the numeric fields have been aggregated, meaning
that a record exists for each combination of account, name, dimension and date.
Additional help
Refer to the Microsoft developers reference for views or email questions to
support@atlasxl.com.au