80670AE
Development I in Microsoft Dynamics AX 2012
R3 CU8
Contents
Online Companion Guide........................................................................................................................................1
80670AE...................................................................................................................................... 1
Development I in Microsoft Dynamics AX 2012 R3 CU8............................................................1
Disclaimer................................................................................................................................................................4
Module 1: Architecture................................................................................................................................5
Module 1: Architecture Video Transcript....................................................................................5
Lesson 1: Module Overview......................................................................................................... 5
Lesson 2: Features of Dynamics AX............................................................................................ 5
Lesson 3: Architecture................................................................................................................. 6
Lesson 4: Data Partitions............................................................................................................. 7
Lesson 6: Model Driven Architecture............................................................................................ 9
Lesson 7: Licensing and Configuration....................................................................................... 10
Lesson and Module Summary.................................................................................................... 10
Practices....................................................................................................................................................35
Practice 1.1: Create a New Model and Development Project...............................................................................35
Practice 2.1: Create a New EDT............................................................................................................................36
Practice 2.2: Create a New Table...........................................................................................................................36
Practice 2.3: Create a Primary Index.....................................................................................................................37
Practice 2.4: Create a Relation...............................................................................................................................37
Disclaimer
This Online Companion Guide is to be used in conjunction with the E-Learning for this course.
This online companion guide can be used to take notes or provide additional information on the
topic.
Module 1: Architecture
for customizing the standard application or even developing new features and modules. In
addition to MorphX, customers and partners can also use Microsoft Visual Studio to develop
solutions.
AX uses the application object tree, or the AOT, as a mechanism to provide a uniform and
compact repository for viewing code and metadata related to AX.
The development concepts are deeply integrated to enable a rapid development
experience. For instance, you can use drag and drop functionality for many of the programming
and customization tasks. AX also supports the concept of projects to help organize and track
customized applications.
We'll take a deeper look at these features over the rest of this course.
The client workspace is the standard rich client interface that an end user uses. Let's
review some of the key components of the client workspace. Within the workspace, the title bar
is the standard Windows title bar. The navigation pane is the menu on the left side of the screen
that shows all of the modules the current user has access to.
The content pane displays role centers, list pages and area pages. Role centers display
specific data, reports, alerts and common tasks associated with a user's role in the organization.
The role center is displayed when an end user opens the application or goes to home in the
navigation pane.
List pages display lists of data. They are optimized to view and search through a list of
records and act on information. Area pages display all menu items relevant to the module
selected in the navigation pane. They are grouped logically to make it easier for end users to
find what they need.
The Windows view and help menus allow you to access the development workspaces,
help, and other informational screens. The address bar provides a breadcrumb IU that allows you
to rapidly navigate to various parts of the application.
The file menu provides access to a host of features such as print, business intelligence
tools, alerts, the ability to export to Microsoft Excel, and so on.
And finally, the status bar shows you information about your current session such as the
current company, currency, layer, partition, user, and so on.
Let's now look at some of the key features of list pages. In this example, we look at the
customer's list page, which is accessible from accounts receivable, common customers, all
customers. Here in the center of the form is a grid that displays the list of customers. Above the
grid is a filter pane that can be used to filter the records that are displayed on the grid. At the
top of the screen is the action pane that contains buttons to open other forms and to take actions
related to the selected customer.
On the right are FactBoxes that show data related to the selected customer. When a
record is clicked on the grid, detail data related to that customer is shown in the preview pane.
Lesson 3: Architecture
Microsoft Dynamics AX has a three-tier architecture. Three-tier architecture is defined as having
a separate database, application server and client, where the database stores the data, the
application server runs the application business logic, and the client application allows users to
connect to the server to access Business Logic and use the data in the database.
In Microsoft Dynamics AX, the three tiers include the following: A SQL Server database
that houses the data entered into and used by the Microsoft Dynamics AX application. There is a
separate database that houses the data, and another one that stores the model store that
contains application elements.
Application elements are explained in the next lesson.
The next tier is an Application Object Server, or the AOS. This is a service that runs most
of the Business Logic. This runs continuously on a central server.
The client application is the user interface through which an end user accesses Microsoft
Dynamics AX. There are various clients available, including the Microsoft Dynamics AX rich client
and the enterprise portal.
Let's take a deeper look at the three-tier architecture that makes up a typical deployment
of AX. At the database tier, we have a few different databases. The Microsoft Dynamics AX
database is an online transactional processes, or OLTP database, that stores all of the business
data in SQL tables. There's also model database that stores all of the metadata and application
code in the model store.
Some BI components of Microsoft Dynamics AX also require you to use SQL Server
Reporting Services and SQL Server Analysis Services. SQL Server Reporting Services, or SSRS, is
used for running reports. The SQL Server Analysis Services, or SSAS, database is derived from
the data in the OLTP database in a format that is optimized for fast reporting and analysis.
The Application Object Server, or the AOS, is the Microsoft Dynamics AX application
server. The AOS is where most of the Business Logic is executed. The AOS runs many tasks.
Some of the most important runs are the X++ runtime that runs the X++ code, which provides
most of the Business Logic in Microsoft Dynamics AX; the security layer, which enforces security
to manage access to data and functionality; the session management infrastructure, which
manages client services; and the web services end point, which enables external applications to
connect to AX using web services.
Multiple AOS servers can be run and installed to spread the processing load over multiple
servers. This improves performance in larger implementations.
Then at the client layer, there are a number of different clients that connect with AX. The
Microsoft Dynamics AX rich client is the primary client to access AX functionality. Most forms
displayed in the rich client are designed by using the MorphX development environment.
Roles central pages are SharePoint pages that are displayed within a rich client form.
SQL reports are culled from the rich client by using the report we are controlling.
Another common client is the Enterprise Portal, or EP. EP pages are displayed through a
web browser. A subset of the functionality and reports are also available on the portal.
Microsoft office can also be used as a client to access the Microsoft Dynamics AX
application and data. Office add-ins are available out of the box for Microsoft Excel and Microsoft
Word. Users can use Excel to view, edit, create and delete data in AX. Word can be used to build
rich documents that source data from AX.
Since the data access is through the AOS, AX enforces user level security on the data and
the fields, even when the data is accessed through the Office applications.
Other applications can also be used as clients to Microsoft Dynamics AX. Examples
include mobile applications, specialized applications written in DotNet, and even Legacy
applications. Applications can be integrated using methods such as web services or the DotNet
Business Connector. The DotNet Business Connector is another client that has no user interface.
It is designed for other applications to access AX Business Logic.
End users can use any application as the user interface that interacts with the AOS
through the DotNet Business Connector.
Developers can access developer tools through the MorphX IDE in the Microsoft Dynamics
AX client or through Visual Studio tools in Visual Studio.
Finally, we have the help server and web service components. The help server hosts
Microsoft Dynamics AX help files through the IIS, or the Internet Information Services. When a
user accesses help from within the rich client, the AOS generates a call to the help server to
display the help pages.
While the AOS is an end point for web services, web services can also be hosted within IIS
when they need to be exposed via http protocol. When hosted within IIS, the AOS is the web
service end point that provides the data that is served to other applications by IIS in a
standardized format.
data isolation. However, data partitions still allow the metadata that supports the business
processes to be shared.
Partitions divide and isolate the business data of an installation by using special
processing that the AOS applies to data queries. Business data that is shared among companies
is only shared between companies that are in the same partitions.
Each Microsoft Dynamics AX client session starts in one partition. Users must start a new
AX client session for each partition they wish to access. Once a session is started, the session
may only access the data and the partition it was started in. For instance, a client session that
was started in subsidiary A may only access the data in partition 1.
Each partition contains at least one company or legal entity. A legal entity occurs in only
one partition. When you create a legal entity, the system assigns it to the current partition.
While a legal entity cannot be moved to another partition, its data can be exported from one
partition and then imported to another company in another partition.
Just to note, partitions were added starting in Microsoft Dynamics AX 2012 R2. When you
upgrade from a version that did not support partitions, you must assign the existing companies
or legal entities to one or more partitions during the upgrade.
the MorphX IDE from the Microsoft Dynamics AX client using the Windows menu in the command
bar and selecting new developer workspace.
Alternatively, you can also use the shortcut keys Ctrl+Shift+W. We'll take a deeper look
at the MorphX IDE in the next module.
X++ is the object oriented programming language that is used in the MorphX
development environment. X++ has C sharp like syntax and incorporates SQL data
manipulation statements. A full list of developer tools in the MorphX development environment
can be found in the developer help documentation.
Some of the tools that are available are the X++ code editor, which is a text editor used
to write X++ code. It supports color-coding and allows you to look up and select various objects
such as method names and enumeration values as your type.
Then we have a debugger, which is an application used by developers to step through X+
+ code to help resolve code errors.
There's also a reverse engineering tool that enables you to visualize data and process in
Microsoft Dynamics AX by creating UML data models, UML object models, and ER data models.
The table browser displays data from all fields in a selected table, and the table browser
can be used to run SQL-like statements.
The Visual Studio development environment is integrated through Visual Studio tools
through Microsoft Dynamics AX and it supports managed code. Close integration between
MorphX and Visual Studio means developers can take advantage of the benefits of each
development tool and work in the environment that best suits the development scenario.
Some development scenarios must take place in Visual Studio, though. This includes
creating and customizing SQL Server Reporting Services reports, most Enterprise Portal web
development, and any managed code development.
The application Explorer is available within Visual Studio. This gives developers the
ability to browse AX metadata. The application Explorer displays information that's similar to the
AOT that we see in the MorphX IDE. In addition, any projects that are created in Visual Studio
can be saved back into the AOT, and they are stored in the Microsoft Dynamics AX model store
on SQL Server.
While developing in Microsoft Dynamics AX, you can group all of your modifications into
one or more development projects. To create a new development project, you can click on the
project icon in the development workspace or press Ctrl+Shift+P. There are two types of projects
that you can create: Private projects or shared projects. Private projects are visible to the user
who creates them, and the shared projects are visible to everyone.
To create a new shared project, you can right-click on the shared note, and select new
project.
Once you open the project, you can drag elements from the AOT into this project. This
creates a reference to the element in the AOT. Modifying elements in the project is the same as
modifying them directly in the AOT.
When you make an element modification on one level, the modification overshadows the
element on a lower level. When the application is compiled, only the top-level version of an
application element is used.
There are three layers that are available only to Microsoft to deliver the base application.
Those are the SYS layer, or the system layer, the GLS layer, or the globalization layer, and the
SPK layer, or the feature pack layer.
Then there are three layers available to partners and ISVs. The SLN layer, or the solution
layer, which includes Microsoft-endorsed industry solutions; the ISV layer, or the independent
software vendor layer, including generic or vertical solutions developed by ISVs. The VAR layer,
or the value added reseller layer, includes multicustomer solutions developed by VARs.
Then there are two layers available to both partners and customers who have a license to
access the AX source code. The Cust layer, or the customer layer, includes customer specific
functionality, and the USR layer, or the user layer, includes installation specific functionality and
customizations.
Let's take the example of customizations across different layers to see how this works in
a running application. In this example, let's assume there are three layers: The SYS layer, the
ISV layer, and the VAR layers, which have application objects. In the SYS layer, you have two
objects: The Cust table and Cust form. In the ISV layer, you have a report called the
FleetReport, and the customization that was made to Cust form. This customization
overshadows the definition of Cust form in the SYS layer.
In the VAR layer, we've made a customization to the FleetReport. When the application
runs, the Cust table definition is from the SYS layer. The Cust form is from the ISV layer, and the
FleetReport is from the VAR layer.
Any modifications in a particular layer override the functionality, but the code in the
underlying layer is not deleted. If later, for instance, you uninstall the model from the VAR layer,
the code in the ISV and SYS layers will take precedence when the application runs.
There are a lot of benefits to using layers within AX. One of them is source code
protection. The elements in the standard implementation in the SYS, GLS and SPK layers can
only be changed or deleted by the Microsoft Dynamics AX development team. The layers help
protect the original source code and keep it separate from modification.
Similarly, ISV solution code is separated in a model within the ISV layer. Any customerspecific changes to the ISV solution would be in a higher layer.
Another benefit is faster and easier upgrades. Upgrades and service packs contain
changes in the lower layers where the base code resides. This means that any changes by
partners or customers are maintained throughout the upgrade.
There are powerful compare and merge tools that are available to guide developers
through the upgrade. These tools highlight elements that are modified in higher layers and that
might therefore require some action to merge the changes.
As an example, the item number is an extended data type that exists in the SYS layer,
this field of a string, which is 20 characters in length. If a company that uses Microsoft Dynamics
AX requires 30 characters for their item numbers, the field length would be changed to 30
characters, and the change is saved in the Cust layer.
The item number data type now exists in both the SYS layer and the Cust layer. The Cust
layer is a higher layer, so when the application is compiled, the 30-character length is used. If in
a future version, Microsoft extends the length of the item to 40 characters, the upgrade tool
would highlight that there is a change in the SYS layer to 40 characters and that there is an
existing change in the Cust layer to 30 characters.
The developer would then have the option to keep the Cust layer change or delete the
Cust layer and revert to the new field length in the SYS layer of the new release.
In addition to layers, AX also uses the concept of models. A model is a logical grouping of
elements within a layer. Models help in situations where multiple ISV solutions or projects must
operate together. This architecture allows many solutions to coexist within each layer. An
element can exist in exactly one model in a given layer. The same element, though, can exist in
a customized version in a model on a higher layer.
New models are easy to create in the MorphX ID and are applied when modifying or
adding objects in the AOT.
Models can be exported, installed, or uninstalled from the model store. Models are
identified by a name and a publisher and can have a set of properties that can be changed,
including a version number.
Let's take an example to see how models work. A company has two lines of business.
They manufacture and sell medical products in one of the lines of business, and in the second
line of business, they also service specialized equipment to produce medical products.
In AX, the SYS layer would contain the base AX application. Solution A is an advanced
vertical solution for the production of food and drug products. Among other things, this solution
adds a new field to the item table to store the government approval number. This is stored in the
ISV layer and in the model called medical.
Solution B is an advanced vertical solution for managing the ongoing service of
equipment, which is sold to customers. This solution adds a new field for the default service
period. This is also stored in the ISV layer and in the model called service. You can use models
to view the modifications made by all of the ISV solutions and easily see where each change
originated.
You can create a model using the development workspace by clicking on tools, model
management, and then selecting create model. After that, you can enter the name of the model,
the company, the layer in which the model is in, the version number, a full description, and a
shorter description.
The combination of name and publisher makes a unique model. To change the current
model, you can use the status bar, click on the model, and select a new model.
o Functional Features
Dimension based
Database
Clients
Security
Session Management
X++ Runtime
Web services
o Data Partitions
Legal entities in one partition cannot see application data and global
application data from another partition
Partitions can still share system data such as application ports and
code
o Development Environments
Visual Studio
Code written in Visual Studio can be integrated back into the AOT
o Development Projects
Layers help isolate code written in one layer from another layer
Module 1: Practices
Practice 1.1: Create a New Model and Development Project
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
When you select open in new window, the selected node is opened in a separate instance
of the AOT, and this is very useful when you want to do drag-and-drop operations between
elements in the AOT.
The third option that's quite common is the export option that's available in the right-click
menu. This allows you to export one or more elements from the AOT into an XPO file.
Next, you have compile, which is available on some nodes, which support it. This
compiles the selected nodes within the MorphX IDE.
You also have the ability to find the nodes. Clicking on find brings up a find dialogue
where you can look for nodes that contain specific text or are named in a certain way and things
like that.
Some of the nodes also have additional properties or additional commands available. In
the add-ins sub-menu of the right-click menu, you have a number of different options. One
interesting option is the check best practices option, which lets you run the system defined best
practices on your customizations. We'll discuss some of the commands that are available a little
later in the course.
Let's now take a deeper look at the nodes that are available in the data dictionary. First
we have tables. Tables are used to store data in the system. Data is typically entered, edited
and deleted through forms. We will discuss tables in a lot more detail later in this module.
Then we have maps. Maps are used to link tables. For instance, you might have two
different tables which are very similar in structure but have fields that are maybe named
differently but have the same data types. If you want to write a class that has some processing
logic against both of these tables, you could build a map that links the two tables that are similar
and then build your processing logic against this map.
Next, we have views. Views are read-only data representations that combine multiple
table objects. Views present a selected set of roles and columns by joining different tables
through data sources and relations between them. Frequently views represent a subset of fields
from a single table to simplify reporting.
Next, we have extended data types. These are customized data types based on the
primitive MorphX data types. We'll talk more about extended data types a little later in this
module.
Base enums are a list of literals that can be used throughout the development
environment in MorphX. The elements in an enum type are created by using the AOT where the
name of the type and the literals can be defined in the definition.
Next, we have license codes. License codes control which elements can be enabled or
disabled. If a license code is not purchased for a module, then any element attached to that
license code cannot be used.
Configuration keys enable or disable features in the application for all users. Each key
controls access to a specific feature, and once it's disabled, the feature is automatically removed
from the user view.
Next we have security keys. The security keys under the data dictionary are a legacy
from previous versions from AX. We will discuss the new security framework, the role-based
security framework, later in this course.
Table collections are used for virtual companies, and then finally, perspectives are a
collection of tables and views with properties set on them, which are used by AX to generate
analysis services cubes. Perspectives are described in more detail in a later course on reporting.
which is used for the general inventory catalog, and Purch table, which is used for purchase order
creation.
Other tables in AX contain system data as well as metadata. System tables are
differentiated from application tables by the SYS prefix that starts the name of the table. You can
learn more about the application tables that are part of AX from the AX ERD website. This site
hosts entity relationship, or ER diagrams, for core tables of the application modules in Microsoft
Dynamics AX 2012 R3 CU8. You can use the site to quickly list all of the foreign key relationships
for a table involving both its child and parent tables. You can also use this site to determine
which module a table is in and which tables are in a particular module.
There are multiple elements in Microsoft Dynamics AX that define a table. Fields, field
groups, indexes, full text indexes, relations, delete actions, and methods. Fields can be used to
create or modify the physical columns in the database table. The fields defined within the fields
node are the columns belonging to the physical table. One note of caution here: Any fields
created, deleted or modified using MorphX in the table node are reflected in the database when
the changes are saved. This can potentially damage the AX application if not used correctly.
Field groups are logical groupings of physical database fields. AX uses field groups to
cluster fields into logical groups so that these groups can be used on forms and reports. An
example of such a group is the group measurement located on invent table.
Invent table holds data relating to products, and the measurement fields are height,
width, depth and density of the products.
If a modification is made to a field group, application elements that refer to the field
group are automatically updated to reflect the new content of the group. This is done using the
IntelliMorph technology that adjusts the layer of forms and reports, which use the modified field
group.
Adding new fields to a field group can be a powerful technique for updating forms that
use field groups within a field.
Every field on a table should belong to a group.
Next, indexes in AX are the physical indexes that exist on the tables in the database.
Indexes can accelerate a search on a table's data. More detailed information on indexes is
discussed later in this module.
Full text indexes contain location information about each significant word in a string field
of a table. Some queries can use this information to run more efficiently and to complete
quicker. These queries that search for words embedded in the middle of string fields. A full text
index can be created by creating a new full text index under the full text index node on the table
and adding fields to this index.
Relations define relationships between tables. AX supports a number of different
relations. We will discuss these in more detail later in this module.
Delete actions govern how data is handled when a deletion event occurs in a parent
table. There are four types of delete actions: None. With this delete action, the row in the table
is deleted but nothing occurs in the specified table. With a cascade delete action, the row in this
table is deleted and all related data in the specified table is also deleted. This ensures that there
are no orphan records that remain after deletion. With a restricted delete action, the row in this
table is deleted only if there is nothing that relates to it in a specified table. This is used when a
parent record should only be deleted when no child records exist, and the child record is
important to keep. For example, transaction records. The next delete action is
cascade+restricted. This works similar to restricted when the table is not part of a cascade
delete. Cascade+restricted works similar to cascade delete when the table is part of a cascade
delete operation from a parent table. Note it's really important to create delete actions and
specify them correctly to ensure data integrity.
Then we have methods. AX uses methods within a table to perform functions specific to
that table. Methods can be used for data lookups to other tables or manipulation of data during
specific events. Table methods are covered in more detail in later development courses.
Finally, AX 2012 introduces the concept of table inheritance. A table can extend another
table by specifying the extend property on the table. This means one table inherits all of the
fields and properties and methods of the table that it extends. New fields and methods that are
added to this extending table will not be visible from the parent table that it is extended from.
With that, we are done with the demonstration to create a new EDT.
Lesson 6: Indexes
Indexes and databases are used to locate records. They are stored separately in the database
and contain a key that can be quickly located in the index and a reference to the record. For
example, the Cust Idx index of the customer table contains the account number of the customer.
The account number is unique and sequenced. This is then used to quickly look up the customer
record through the reference.
There are two types of indexes: Unique and non-unique. If a unique index is created
based on a column, AX ensures no duplicate key values occur in that column. Also, updates on a
column that contain a unique index, which violates the uniqueness of the column, cause an error.
Non-unique 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.
Do not create an index if it is not needed because they use system space and must be
updated every time data is created, edited or deleted. This can slow down the updating process.
However, in most cases, the performance gained when selecting records far outweighs the
performance lost when updating.
When an index is created, it is recommended to give the index a name reflecting the
names of the fields in the index followed by the suffix Idx. An index can be based on either one
or more fields that are part of the table the index is being created on.
Creating an index in AX always relates to the table where it's created. The index can only
be created on fields that exist in the table. These indexes can be unique or non-unique, and are
based on a single column or multiple columns that exist within the table. Let's take a look at how
to create an index on the SpeciesID field in the VetSpeciesTable.
Let's go into the AOT, and under data dictionary tables, we're going to find the
VetSpeciesTable. Here, right-click on the indexes node and select new index. This creates an
index called Index 1. Let's rename this index to SpeciesIdx. Then we're going to drag the
SpeciesID into the SpeciesIdx index, and then in the property sheet for the SpeciesIdx index, let's
set the allow duplicates to no, and we'll also set the alternate key to yes.
With that, we're done with creating a new index. Let's save the table. This concludes the
demonstration to create a new index.
A primary index is one or more columns that uniquely identify one record in a table from
all the other records. A primary index is a unique index for a table that is either a surrogate key
or one of the indexes that are marked as alternate keys. To set an index as a unique index, you
can set the index property called allow duplicates to no. To set an index as the alternate key,
you can set the alternate key property of the index to yes.
A typical example of a primary key is on the CustTable, where the customer's Account
Num field is used as the primary key. The Account Num field is used in the account Idx index,
which is a unique index. This index is then set as the primary index for the CustTable in the
properties of the table.
When a primary index is not specified, AX uses a surrogate key as the primary index. The
surrogate key is used on many of the relations between tables.
Let's now set the index created in the previous demonstration on the VetSpeciesTable to
be a primary index. The first thing we need to do is make sure that the SpeciesIdx index is a
unique index, so it has the allow duplicates property set to no, and also we want to make sure it's
marked as an alternate key, so the alternate key property is set to yes. To set the SpeciesIdx
index as a primary index, go into the VetSpeciesTable, and then find the primary index, property,
and change this to SpeciesIdx. Then save your changes, and with that, you're done with the
demonstration to set a primary index on the VetSpeciesTable.
Lesson 7: Relations
Relations between tables are used to associate roles in one table to roles in another table.
Relations are used to enforce business rules across tables. They can also be used to create auto
joins and forms, look up values in other tables, or to validate data by providing constraints. They
can also be used to automatically propagate changes from one table to another by defining
cascading relations, and they can be used to generate field help.
Relationships can be created between tables using MorphX. A key thing to note here is
that relations are defined within the AX application and not at the physical database level.
Under the relations node, you can create different types of relationships between the
parent table and other tables in AX. Normal specifies related fields in another table. Multiple
fields can be included in this relation. For example, the table logistics postal address has a
relation called state that defines the relation to the logistics address state table. The values
allowed in the state field are limited, depending on which country is entered.
Field fixed and related field fixed are conditional relations. Conditional relationships can
be created by adding a condition to a table relation. Only records that fulfill the condition are
included in the relation.
A condition on a relation filters the records on either the table that contains the relation
or the related table, depending on the type of condition. Field fixed specifies that the condition is
on the table that contains the relation. Related field fixed specifies that the condition is on the
related table.
Field fixed and related field fixed are normally an enum.
Foreign key specifies a correspondence between a foreign key field in the present table to
the primary key field in another parent table. A foreign key can be a primary key or a single field
alternate key. When it is a primary key, the relation is on the primary key field. For example, a
customer account. When it is a single field alternate key, the relation is on the surrogate key,
which is usually the rec ID
Let's now take a look at creating a relation between the breed and the species table. A
breed is related to the species table in that a breed of Labrador is related to the record dog in the
species table. You should not be able to have a breed of Labrador be related to a species of cat,
for instance.
Let's start with updating the VetSpeciesID EDT to set the reference table to be
VetSpeciesTable. To do this, I'm going to go into the data dictionary, extended data types, and
find VetSpeciesID. I'm going to right-click on this and go to the properties sheet and set the
reference table to VetSpeciesTable. Then we're going to expand the table references node, rightclick on table references, and create a new table reference.
Then we need to make sure that the related field is set to SpeciesID. After that we can
save our changes to be VetSpeciesID EDT. When we get a dialogue to synchronize the database,
I'm going to click on yes. At this point I can use the species -- VetSpeciesID EDT on the
VetBreedTable. To do this, I'm going to open a second AOT window, expand the tables, and
navigate to VetBreedTable. Here under fields, I'm going to drag the VetSpeciesID field into the
fields node. As soon as I do this, I'll get a dialogue asking me if I want to create a foreign key
relation, which is exactly what I want to do, so I'm going to click on yes.
This will automatically create a relation between the VetBreedTable and the
VetSpeciesTable, so if I go into the relations node and now see a new relation for VetSpeciesTable,
which says VetBreedTable.VetSpeciesID equals VetSpeciesTable.SpeciesID. I'm also going to
rename this field from VetSpeciesID to just SpeciesID. I can now save this table, and with that,
I've created and completed creating a relation. I could also have created a relation manually by
right-clicking on the relations node on the table. However, when we create a reference on the
EDT and set it as the primary key, once the EDT is added to the table, the system will
automatically prompt you to create a reference.
Lesson 9: Views
An AX view is a virtual table that provides the data records and fields that are specified by a
query. 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.
In AX you can use views wherever tables are used. For example, you can use a view in a
form, a report, or even in X++ code. Views are synchronized into SQL just 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 recreated in the database.
Some of the benefits of views are that you can get focused data. A view is used to
retrieve and return only the data that is relevant for a particular user or scenario.
Next, a view enables the views of a complex query to create highly customized set of
data. For example, a view often represents data as a single table that is retrieved from multiple
joined tables and may use many conditions.
Furthermore, a view can improve performance by returning only the relevant fields to the
user. When a view is created, the view definition is generated and stored in the database. When
that view is then accessed, the view dynamically retrieves the data that satisfies the view
definition
Because of this, a view can provide better performance than calling an equivalently
complex query.
Finally, we discussed the concept of views and how it can help present a simplified view of a
complex query.
o Tables
Store data
o Data Types
o Indexes
o Relations
Normal relation, Field Fixed, Related Field Fixed and Foreign Key
relations are supported
o Base Enums
o Views
Synchronized to SQL
Module 2: Practices
Practice
Practice
Practice
Practice
Practice
2.1:
2.2:
2.3:
2.4:
2.5:
__________________________________________________________________________________________
________________________________________________________________________________
Lesson 2: Forms
Forms are the primary method of interaction between AX and the end user. By understanding
and exploring existing forms, new forms can be developed while retaining the same look and feel
as standard AX forms.
Forms are composed of a few categories of elements: Methods, data sources, parts,
designs and permissions. Form methods are blocks of X++ code that, for example, are executed
when opening or closing the form.
Form methods are discussed in later development courses.
This module discusses data sources, designs and parts. The next module will discuss
permissions.
Several different standard form designs are available for use in different situations. To
better understand forms and their design, let's take a look at a few forms that are available in
the application.
In this demonstration, let's take a deeper look at a few of the forms that are available in
AX to understand the elements of a form. Let's start by taking a look at the CustTableListPage.
To do that, I'm going to go into the accounts receivable module, and under common, customers,
select the all customers menu item. This opens the CustTableListPage, customers list page, and
what you see is at the center of this list page is a grid which displays the list of customers.
Above this grid, we have a filter pane which I can use to filter the data that's shown in the
grid. For instance, if I want to show only customers whose name starts with Contoso, I could
type Contoso here and press enter, and this will filter the grid to only show customers whose
name starts with Contoso.
Above the filter pane, I have an action pane which has a set of action pane tabs, and
each of these action pane tabs have a set of buttons which help you perform actions related to
the particular list page.
Different list pages may have a different set of buttons.
For instance, on the customers list page, we have the ability to create a new customer,
edit the selected customer, maintain their -- set up their bank accounts and so on.
To the right of this list page are a set of FactBoxes. FactBoxes display information from
other tables that are related to the currently highlighted customer record.
At the bottom of this list page is a preview pane that displays additional information from
the customer table for the selected record.
As I change the selected record, the information in the FactBoxes and the preview pane
changes.
Let's now take a look at the design for this particular list page. To do that, I'm going to
select personalize, click on the information tab, and then click the edit button next to the form
name. We can see that the form name is CustTableListPage.
Clicking the edit button opens the CustTableListPage in the AOT. All forms have a similar
set of root nodes. They have methods, data sources, parts, designs and permissions. Data
sources contain the list of queries and tables from which the form sources its data
Let's expand the design node. We can now look at the action pane, and you'll notice that
the action pane has a set of action pane tabs which correspond to the action pane tabs on the
actual list page.
We have the home tab, the sell tab, the invoice tab and collect tab. Similarly, you have
the home tab, which is the customer, the sell, the invoice, and collect.
Expanding the home tab, we have a set of button groups such as new group, maintain
group, customer accounts group. This corresponds to the button groups on the home tab, the
new, the maintain and the accounts.
Expanding one of these button groups, we see a set of menu item buttons, the edit, edit
list and delete, which correspond to the edit, edit in grid and delete.
Then we have the grid control, which contains a set of string controls which are bound to
the corresponding fields on the table, and you have the same set of controls on the grid. You
have the name, the customer account and telephone, and if we look at the AOT, we have the
name, the customer account and the telephone.
Let's now take a look at a different form. To do that, we're going to take a look at the
detail form for customers. I'm going to hit edit on the Contoso Europe customer. This opens the
customer detail form. Here you'll notice that there's also an action pane at the top and a set of
FactBoxes on the right, but the center of this form is a set of fast tabs which display additional
information about the customer.
If we look at the design for this particular customer by clicking the personalize option,
and clicking the information tab, and selecting the edit button, you'll notice that the form is now
CustTable. Here we have a set of design elements. We have the action pane header, and then a
tab. The tab contains details, and then a tab header, which contains a set of tab pages. Each of
these tab pages corresponds to the fast tabs that you see on the form. For instance, we have
the general, address and communication tab pages, which are general addresses and contact
information on the customers form.
If we expand the general fast tab and look at the upper group and the identification
group, you'll see that there's an account number and a record type field. If we expand the
general, you'll see that there's an account and record type field here.
Let's now take a look at a simpler form. To do this, we're going to go into the sell tab and
click on sales price and then sales price. This opens the sales price form, which as you can see,
is a much more simpler form. There's a grid which displays data, and then a detail section at the
bottom that displays additional data based on what is selected in the grid.
Let's view this in the design node. Here again, we have a design, and then if we expand
the tab and look at the grid, you'll notice that there are a set of fields on the grid like the relation
and currency. These correspond to the fields on the grid like the relation and the currency.
With that, we come to the end of the demonstration on examining form design.
Because forms present data to users, they must provide a source for the data. These
collections of data are called data sources, and they link to the tables in the AOT.
For instance, when we expand the data sources node for the PriceDiscTable form and
view the properties for the PriceDiscTable data source, we will see a number of properties. For
instance, the allow create and the allow delete control whether you can create new roles or
delete old roles from the price agreement form. The table property specifies the table the data
source is based on, in this case the PriceDiscTable.
The index property controls the index that is used for sorting data within the form.
More than a single data source can be used on a form. The linking of data sources is
performed by using the join source properties. Joining data sources on a form is examined later
in this module. The InventDem data source on this form is joined to the PriceDiscTable, and the
system uses relations between the tables to join the records together. Expanding the
PriceDiscTable data source will display fields that list all of the fields on the table. Properties can
be set here to control the behavior of the field when it is used as a control on the form, including
allowing the field to be edited and whether it was visible or not.
In this demonstration, we'll create a form that will be used to view, create and edit
records in the VetSpeciesTable.
To create the form, let's go into the AOT. In the AOT, we're going to go into the forms
node, right-click on the forms node, and select new form. The form that opens, let's go into the
properties sheet and change the name of the form to VetSpeciesTable. We'll then go into the
data dictionary and find the VetSpeciesTable. To do that, I'm going to open the data dictionary in
a new window. I'm going to close the properties sheet to get some more space, expand tables. I
have the VetSpeciesTable. I'll then expand the forms node and drag the VetSpeciesTable into the
data sources node of the VetSpeciesTable form.
Then I'm going to expand the designs node and click on design, right-click, and say new
control, and select grid. This creates a new grid control for the VetSpeciesTable. I can then open
the VetSpeciesTable data source in a new window and then drag the fields name and SpeciesID
from the VetSpeciesTable data source into the grid.
For the design node, I'm going to change the property for the caption to species. I can
now save the changes to this form, and then let's open this form by right-clicking on the form
and selecting open. This lets us create new species. For instance, I can create a species called
cat with a SpeciesID called cat, then create another species called dog with the SpeciesID dog,
and press close. Let's take a look at the table, the VetSpeciesTable. Open this, and you'll see
that two new records got created for cat and dog in the table.
With that, we come to the end of the demonstration to create a new form. As you can
see, it's really easy to create new forms within AX and bind them to tables without having to
write any code.
With this, we conclude the demonstration on how to add a second data source to a form.
Then let's take a look at a simple list details. For this, we're going to go into general
ledger, setup, currency, and then click on currencies. Then we have a simple list template for
which we can find in master planning, and then under inquiries, go to processes, and then click
on planned orders log.
The next form template we'll look at is the table of contents form template, which we can
find under accounts payable, setup, accounts payable parameters. Here we have a set of items
on the left with content to the right.
Then we have a dialogue template, which we can find under product information
management, products, products, and then click on new product.
To create a form using a template, we can do this from the AOT. Let me open a new
instance of the AOT. And then under forms, we would select new form from template and select
the type of template that we want to use.
With that, we come to the end of the demonstration on the different types of form
templates.
and not for US 027. This is done because we set the data source property on the menu item
button to be CustTable.
With this, we are done with the demonstration to add a menu item to an existing list page.
Lesson 7: FactBoxes
A FactBox is a small selection of data related to the current record in the list page. There
are three types of FactBoxes.
InfoParts have its own data source and a number of controls. They are limited in what
can be displayed. However, InfoParts are simple and quick to create and can also be displayed in
the Enterprise Portal.
A form part is a link to a form. The form can have the same controls as a standard form.
However, since this is displayed in a FactBox, adding too many controls can crowd the part.
Cues display a count of the number of records related to the current record in the list
page. For example, it might show the number of outstanding invoices for a customer.
In this demonstration, we'll create a new FactBox and add it to a list page. Let's create a
simple FactBox to display the customer specs.
Before we can create a FactBox, we first need to create a query. Since this FactBox is
going to show the list of pets for a customer, we're going to create a query that's going to be
returning data from the VetCustPetTable table that we had created previously in our practice. To
create a query from the AOT, you need to right-click on the queries note and select new query.
Then in the properties sheet for this query, let's rename the query to VetCustPetInfoPart. Then
we need to add the VetCustPetTable table into the data sources for this query. To do that, I'm
going to open a second AOT window, expand the data dictionary tables, and drag the
VetCustPetTable into the data sources node.
The next thing we need to do is set the fields dynamic property to yes. This makes sure
that all of the fields that are on VetCustPetTable are included in the query.
The next thing that we need to do is locate the VetBreedTable and add it as a data source
under VetCustPetTable.
Let's drag this VetBreedTable under the data sources of VetCustPetTable.
We are then going to set the dynamic property on the VetBreedTable to also yes, and
then on the VetBreedTable, we're going to set the relations property to yes. We now have a
query that's going to return all of the pets for a customer along with the information about the
breed for the given pet.
Now I can save this query by pressing Ctrl+S. After this, I can create a new InfoPart.
We're going to do that by expanding the parts node, right-click under InfoPart, and select new
InfoPart.
We're going to go to the properties sheet for this InfoPart, and I'm going to call this
VetCustPetInfoPart. For the caption, we're going to call this pets, and we're going to change the
query to be the query that we created, which is VetCustPetInfoPart. I've now created the
InfoPart, and I can expand the InfoPart.
On the layout node, I'm going to right-click on the layout node and select new group. On
this new group, we want to create a set of fields to display the name of the pet as well as the
breed of the pet. Because this is going to be a list of pets, I'm going to change the repeating
property to be yes. This makes sure that the InfoPart renders as a table.
Then I'm going to add a couple of fields to this InfoPart. The first field is going to be
based on the VetCustPetTable and the data field is going to be the name of the pet. The second
field is going to be based on the VetBreedTable, and the name field of the BreedTable will be the
data field.
We can now save the changes to the InfoPart. At this point we are ready to add the
InfoPart to our list page. Before we do that, we need to create a new menu item for the InfoPart.
To do this, I'm going to navigate to the menu items and then drag the InfoPart from the InfoPart
node into the display node of the menu items. I can now save this.
Next I'm going to locate the VetCustPetTable table and create a new index on customer
account. So far we've not created an index on CustAccount on VetCustPetTable. Adding an index
is going to make accesses to this table on the customer account number more efficient. So let's
create a new index. We'll call this index CustIdx, and then we're going to drag the CustAccount
as a field within the index.
Let's save changes to this table. And now let's add the InfoPart to the CustTableListPage.
To do this, I'm going to navigate to the form for the CustTableListPage in the AOT, and then I'm
going to drag the menu item that we created on to the parts node. We'll drag the
VetCustPetInfoPart on to the parts node of CustTableListPage. This adds the InfoPart on to the
CustTableListPage. I can now save the list page.
And then in the property sheet for the new reference, we're going to set the data source,
relation to the VetCustPetTable.CustAccount. Let's now save the changes to this list page and
then open the list page from AX. I'm going to go back into the list page, and you'll see there's a
new FactBox that shows the list of pets.
When I select U.S. 027 it's showing me that there's one pet. If I select DE 001, it's going
to show me the two pets that are part of the DE 001 customer.
With this, we come to the end of the demonstration on creating a new FactBox.
Can set properties on data sources to control whether the form allows
create, delete, edit operations
o Menu Items
o Form Templates
List Page
Simple List
Table of Contents
Dialog
Drop Dialog
o List Pages
Primary method of displaying data in AX. Can show lots of data from
many tables
Contain Fact Boxes, Action Pane, Grid, Filter Pane and Preview Pane
o Fact Boxes
Module 3: Practices
Module 4: Security
Lesson 2: Definitions
Let's take a look at some of the definitions related to the role based security framework.
Role based security is defined with the following base concepts: An end user is given one or
more security roles. A security role represents a behavior pattern that a person in the
organization can play. For example, you have the accounts receivable manager security role.
A security role includes one or more duties. A duty is a responsibility to perform one or
more tasks. Examples of the accounts receivable manager's duties are to maintain the customer
master and inquire into the chart of accounts. A duty can include one or more privileges.
Privileges satisfy the access that is required to perform a duty. For example, the duty of
maintaining the customer master requires privileges to maintain customer addresses and to
maintain customer bank accounts.
A privilege may in turn include one or more permissions. Permissions include the access
level to one or more securable objects that are required to perform the function associated with
an entry point. For example, the privilege of maintaining customers requires that we give full
control to the customer form, access through the entry point of a display menu item. It also
requires full control to create a new address, access to the entry point of an action menu item.
Let's review the security concepts again from within the AX application. We'll look at
entry points, permissions, privileges, duties and roles and how they relate with each other.
We'll start with looking at these concepts in the AOT, and first take a look at the concept
of entry points. An entry point is an element that is triggered by a user action to start a
particular function such as a form or a service. There are three categories of entry points
available in AX. The first is menu items, which point to forms, reports and classes that an end
user can access from the rich client.
The second category are web content items such as URLs or actions that an end user can
access from the Enterprise Portal.
The third category are service operations that are used in document service classes in
the Application Integration Framework, or AIF. AIF exchanges data with external systems by
sending and receiving XML documents.
Next let's take a look at permissions.
Permissions refer to the access levels that can be applied to securable objects such as
tables, forms, fields, reports or server side methods that are accessible through an entry point.
Permissions are maintained by a developer in the Application Object Tree.
Let's take a look at permissions on a particular form, on a specific form to understand this
better. We'll take a look at the permissions on the CustTable form in this example.
On the CustTable form, there is a node called permissions, which if we expand, we see
there are four different permissions that are possible. There's read, update, create and delete.
What this is saying is that this particular form, the CustTable form, can be opened in either read,
update, create or delete mode, and when it is opened in each of these modes, we can give
specific access to the various controls, stables, server methods and associated forms on this
particular form.
For instance, if the form is open in read mode, the user would have effective access of
read to the company info table. They would have effective access of read to CustTable and
effective access of read to the DirPartyPostalAddressView.
If we look at the permissions when the form is opened in update mode, the CustTable
provides effective access of update, but the user only has an effective access of read to the
DirPartyPostalAddressView.
There are a number of different effective access that are available to be set here. For
instance, you have no access; this implies that the user does not get any access to the data.
Read access implies that an end user can view data. Update access implies that an end user can
view and edit data. Create access implies that an end user can view, edit, create new data.
Correct access implies that an end user can view, edit, create, new and correct date effective
records without creating new records. And finally, the delete option implies that an end user can
view, edit, create, new and delete data.
Permissions that give access to reports or classes need to only have access or not have
access. Like I mentioned, reports are typically given read access, and classes are typically given
delete access.
Permissions that give access to tables or fields can make use of all the access levels. The
possible permission levels are defined on the entry point target. For example, a form might allow
permission levels to read, update, create or delete. The level to be granted to an end user is
defined on the permission itself.
Let's now take a look at privileges. You can find privileges under the security node in the
AOT. A privilege is a group of related permissions that are required to perform a duty. Privileges
can be assigned directly to roles. However, for easier administrative maintenance and also to
use desegregation of duties feature, it is recommended to group privileges into duties and then
assign duties to roles.
Privileges are typically maintained by the developer in the AOT. However, they can also
be maintained by a system administrator in the rich client. A best practice is for privileges to be
maintained in the AOT and to assign privileges to duties.
Let's take a look at a couple of examples for privileges. We'll continue with the CustTable
example. Here we're going to look at the privileges for CustTableMaintain and CustTableView.
The CustTableMaintain privilege has as entry points the CustTable menu item. If you look
at this entry point in the property sheet, you'll see that it's pointing to the CustTable menu item
display and providing access level of delete. What this means is if a user has the privilege for
CustTableMaintain through the duties or the role that he is assigned, then when they try to click
on the CustTable menu item, display menu item, they would open that target, which would be
CustTable, with a permission set of delete. They'd get all of the permissions that are defined on
the CustTable form under the delete node.
Now, if we look at the CustTableView privilege, we have the CustTable menu item as entry
point here, but you'll notice that the access level, when someone has the CustTableView
privilege, is read. What this means is if someone who has CustTableView access clicks on the
display menu item for CustTable, they would open the CustTable form with a permission level of
read.
Next let's take a look at duties. Before that, you'll also notice that you can have
permissions defined directly under privilege, but it's easier to define permissions on the target
item.
Let's take a look at duties. Duties are a group of related privileges that are required to
perform a task. Duties are usually grouped into process cycles, and process cycles are used in
the rich client to make it easier for a system administrator to view and find related duties when
setting up security.
Finally, we have -- under process cycle, you have a set of duties, and finally we look at
roles. Roles are a group of duties that are required by an end user to do his or her job based on
the end user's role in the organization. Roles can be organized into a role hierarchy in that a role
can contain sub-roles and inherit the permissions from the sub-role. For example, the accounting
manager role could be defined as a combination of a manager role and the accountant role. A
role hierarchy reduces the need for duplicating security access that makes access change
management simpler.
Now when a user is assigned a role, it is assumed that they would perform all of the
duties specified by the role, and that when performing a particular duty, they would get a set of
privileges, which in turn give them permissions to AX objects in a certain mode such as read,
update, create, delete and so on. With this, we come to the end of the demonstration to look at
the security concepts that make up the role based security framework in AX.
We're going to click on next, and we're done with this wizard. I'm going to click finish. With that,
Tony will be imported into AX as a user.
Let's look for Tony. And we see that Tony is created as an Active Directory -- created from
an Active Directory into AX.
With that, we've added the inquire into service orders to the role content for the accounts
receivable manager. Duties can also be assigned to a role in the security node under the roles
node in the AOT.
Here you can drag-and-drop duties from the security duties node to the role. Just note, if
you make changes to roles from within the rich client, to see these changes, you may need to
refresh the elements in the AOT so that the changes made in the client are visible. To do that,
you can clear the caches by using the tools menu under caches and selecting refresh elements.
With this, we are done with the demonstration to add duties to an existing role.
roles. In addition, there are tools available within the AOT to view from a menu item all of the
related security roles and objects. This is useful if you need to know all the users who have
access to a particular form, report or action.
Let's do a quick demonstration on how to view all of the roles with access to the
CustTableListPage.
We're going to find the CustTableListPage menu item, and then from there find the related
security roles that have access to the CustTableListPage. To do this, I'm going to expand the
menu items. The CustTableListPage is under the display node, and I'm going to look for the
CustTableListPage. I can then right-click on this list page, and under add-ins select security tools,
and click on view related security roles. This displays a list of all roles with access to the
CustTableListPage.
If we choose, we can also click on export to Microsoft Excel, to export this list to Excel.
o Definitions
Roles
Duties
Privileges
Permissions
Entry Points
o Investigate Access
Module 4: Practices
Practice 4.1: Create a New Security Role
Practices
Practice 1.1: Create a New Model and Development Project
Scenario
The following step procedures and practices will demonstrate how to create a modification that
can be used in a veterinary surgery. The surgery procedure will need to keep track of each
animal that arrives, the owners of the animal, the species, the breed, and details of each visit
including the date, reason and the cost.
In this practice you will create a model and a development project to keep your modifications
organized. During the remainder of the course, any elements you modify or create should be
added to this project.
Isaac, the Systems Developer, needs to make a number of modifications to the system. He wants
to be able to group all the elements he creates and modifies together in one place, and also
make it easy to move the modifications to test and production systems later.
Step by Step
1. Create a model for Dynamics AX Development I training practices
a. Click Tools > Model Management > Create Model.
b. Enter Dev1 in the model name, your name in the publisher and
Dynamics AX Development I training practices in the description.
c. Click OK.
d. Click Close on the infolog dialog.
2. Create a project for Dev I training
a. Press Ctrl-Shift-P to open the development projects window.
b. Right-click the Shared node and select New > Project.
c. Rename the project to Dev I Training.
Step by Step
1. Create an EDT for VetBreedId
a. Open a new development workspace.
b. In the AOT, expand the Data Dictionary node.
c. Right-click the Extended Data Types node.
d. Select New > String. A new EDT called Type1 is created.
e. Right-click Type1 and select Properties.
f. Modify the property Name to VetBreedId.
2. Extend from SysGroup and change label to Breed Id
a. Modify the property Extends to SysGroup.
b. Modify the property el to Breed Id.
c. Close the property sheet and click Save in the AOT to save your changes.
d. On the Database Synchronization dialog, click Yes.
Step by Step
1
Create VetBreedTable
d. Open a new development workspace.
e. In the AOT, expand the Data Dictionary node.
f. Right-click on the Tables node and select New Table. A new Table
called Table1 is created.
g. Right-click Table1 and select Properties.
h. Modify the property Name to VetBreedTable.
i. Modify the property el to Breed.
j. Close the property sheet.
Step by Step
1
Step by Step
1. Create VetCustPetTable
a. Open a new development workspace.
b. In the AOT, expand the Data Dictionary node.
c. Right-click the Tables node and select New Table. A new Table called
Table1 is created.
d. Right-click Table1 and select Properties.
e. Modify the property Name to VetCustPetTable.
f. Modify the property el to Pets.
g. Close the property sheet.
2. Add CustAccount, VetSpeciesId, Name and VetBreedId fields to the
VetCustPetTable
a. Press Ctrl-D to open another AOT.
b. Expand the Data Dictionary node.
c. Expand the Extended Data Types node.
d. Locate the CustAccount EDT.
e. Drag the CustAccount EDT to the Fields node of the
VetCustPetTable table.
f. Locate the VetSpeciesId EDT.
g. Drag the VetSpeciesId EDT to the Fields node of the
VetCustPetTable table. A new field called VetSpeciesId is created.
h. Right-click the VetSpeciesId field and click Properties.
i. In the Name property, set the name of the field to SpeciesId.
j. Close the property sheet.
k. Locate the VetBreedID EDT.
l. Drag the VetBreedID EDT to the Fields node of the VetCustPetTable
table. A new field called VetBreedId is created.
m. Right-click the VetBreedId field and click Properties.
n. In the Name property, set the name of the field to BreedId.
o. Close the property sheet.
3. Create a relation to the VetBreedTable
a. Right-click the Relations node on the VetCustPetTable node and
select New Relation.
b. In the properties sheet for the new relation, set the Name property to
VetBreedTable and the Table property to VetBreedTable.
c. Right-click the VetBreedTable relation, select New > Normal.
d. In the property sheet for the new normal relation, set the Field to
BreedId and the RelatedField to BreedID.
e. Save your changes.
Step by Step
1. Locate the Gender enum in the Base Enums node in the AOT.
2. Drag the Gender enum to the Fields node in the VetCustPetTable table.
3. Save your changes to the table.
Step by Step
1. Create a form called VetBreedTable
a. In the AOT, right-click the Forms node and select New Form
b. Rename the form to VetBreedTable.
c. In a second AOT, locate the table VetBreedTable.
2. Add the VetBreedTable table to datasources
a. Drag the table VetBreedTable to the DataSources node on the
VetBreedTable form.
3. Add the BreedId and Name to the design
a. Expand the Designs node on the VetBreedTable form.
b. Right-click the Design node and select New Control > Grid. A
new Grid control is created.
c. Expand the DataSources > VetBreedTable > Fields node.
d. Drag the fields BreedId and Name to the grid control.
e. On the properties sheet for the Design node, in the Caption
property, enter "Breed".
f. Save your changes to the form.
4. Open the form by pressing Ctrl+O.
Step by Step
1. Create a Form from SimpleListDetails template called VetCustPetTable
a. Right click the Forms node of the AOT and select New Form from
Template > SimpleListDetails.
b. Rename the form VetCustPetTable.
Step by Step
1. Create a
a.
b.
c.
d.
2.
3.
4.
5.
6.
MaintainPets Privilege
Open the AOT.
Expand Security > Privileges.
Right-click Privileges and select New Privilege.
In Properties change the name to MaintainPets and the label to
Maintain pets.
e. In Properties change the name to ViewPetTypes and the label to
View pet types.
Add the VetCustPetTable menu item to the entry points with delete access
a. Expand Maintain pets to display Entry points.
b. Open a second AOT.
c. Expand Menu items > Display.
d. Drag-and-drop vetCustPetTable menu item to the entry points
node and specify Delete access in the property sheet.
Add the VetSpeciesTable menu item to the entry points with read access
a. Expand View pet types to display Entry points in the first AOT.
b. Drag-and-drop vetSpeciesTable menu item to the entry points node
and specify Read access in the property sheet.
Create MaintainPets duty
a. Expand Security > Duties.
b. Right-click Duties and select New Duty.
c. Rename the new duty to MaintainPets.
d. Set the label property to Maintain pets.
e. Drag-and-drop the MaintainPets privilege to the Maintain pets duty.
f. Drag-and-drop the ViewPetTypes privilege to the Maintain pets duty.
Add MaintainPets to the TaxRevenue process cycle
a. Expand Security > Process cycles.
b. Drag-and-drop the Maintain pets duty to the TaxRevenue cycle.
Create a VetReceptionist security Role
a. Open the Security roles form in the rich client & path is System
administration/Setup/Security/Security Roles.
b. Click New.