Showing posts with label Tables. Show all posts
Showing posts with label Tables. Show all posts

Sunday, February 19, 2017

Table inheritance in Dynamics AX 2012

Microsoft Dynamics AX 2012 supports table level inheritance.
A table can extend from another table if its SupportInheritance property is set to Yes. Otherwise the table cannot extend from another table.

When a table A is created:

  • It is default inherited by Common table, this value cannot be seen in the table Extends property
  • When a variable (or buffer) of table A is declared, this variable inherits class of xRecrod by default
Cannot inherit from any other table

















You need to set Extends property of a table to specify its parent table. When a table A inherits from table B:
  • Table A will contain all the fields of table B but you cannot see them in AOT view
  • When a variable (or buffer) is declared of table A, it will access all the methods of table B and methods available in xRecord class
Table has inherited from another table


















Hope it helps !!!

Saturday, February 18, 2017

System fields of tables in Dynamics AX

When we create table in Dynamics AX, we create fields in that table. Those fields are then created as columns in the SQL database. These are called Custom Fields.

The AX framework manages some fields by itself, these are called System Fields. Some of the system fields are automatically generated (with a table property value set to Always in below table) and some fields are created on the choice of the developer.

To create the desired system field on your table you need to set table's property according to the following table:


System field
Table property
RecId
Always
RecVersion
Always
DataAreaId
SaveDataPerCompany = Yes
CreatedBy
CreatedBy = Yes
CreatedDate
CreatedDate = Yes
CreatedTime
CreatedTime = Yes
CreateTransactionId
CreateTransactionId = Yes
ModifiedBy
ModifiedBy = Yes
ModifiedDate
ModifiedDate = Yes
ModifiedTime
ModifiedTime = Yes
ModifiedTransactionId
ModifiedTransactionId = Yes

Hope it helps !!!