AX’s AOT Data Dictionary folder
AX tables are similar to SQL Server tables in that the data is stored in columns and rows. In fact, when saving changes to an AX table, AX will synchronize these changes with the SQL Server database and in the end create a SQL Server table.
Here we can see the different subfolders of an AX table:
AX’s AOT Table
Most of these subfolders look similar to SQL Server objects. We have the “fields” folder which represents the columns in the table and also objects like indexes, full-text indexes, relations and delete actions. Delete actions can be thought of as SQL delete triggers.
There are other folders which provide additional functionality to AX tables and are not available in standard SQL Server tables. Objects like: Field groups and methods.
Field groups allows the user to create a subset of fields in order to facilitate the retrieval of specific data columns.
Methods provide the capability of adding X++ code to tables. For example, you can add code to recreate SQL Server’s triggers functionality for update and insert methods or to provide more complex routines when deleting data. The possibilities that methods provide to the functionality of a standard table are limitless. You can implement complex business rules, validations, lookups, etc.
An AX table is treated as an object and new static methods can be created so that search functions can be implemented. A common example is the find method that is implemented in most of the standard AX tables in the system. You can also extend the functionality of a standard table method by using inheritance which is a concept used by object oriented programming.
You can access a static method by using two colons after the table name and passing parameters (if required.) The following example searches for an item in the InventTable table and returns the matching record and stores it in the varInventTable variable.
varInventTable = InventTable::find(“abc”);
Variable varInventTable is a variable of type “table” and, as you can see, there is no need to instantiate the table to access its static methods, making it easy to add intrinsic table methods to the tables themselves.
Tables in AX provide way more capabilities than standard SQL Server tables. In future articles we will discuss more of these capabilities, their advantages and, why not, some of their shortcomings too.
This article was written by Eduardo Sicouret, Dynamics Technical Consultant for
by Tridea Partners