0% found this document useful (0 votes)
164 views2 pages

Inheritance and Extends Properties, Which Can Be Used To Control Table Inheritance

Table inheritance in Dynamics 365 allows tables to extend, or inherit fields from, parent tables higher in the table hierarchy. The base, or parent, table contains common fields that derived, or child, tables inherit. Child tables also contain unique fields. For inheritance to work properly, a type discriminator field named InstanceRelationType of type Int64 must be defined on the root table. Child tables set the Extends property to the parent table to inherit its fields. Setting SupportInheritance to Yes on both parent and child tables enables the inheritance relationship between them.

Uploaded by

Saibabu Akkala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views2 pages

Inheritance and Extends Properties, Which Can Be Used To Control Table Inheritance

Table inheritance in Dynamics 365 allows tables to extend, or inherit fields from, parent tables higher in the table hierarchy. The base, or parent, table contains common fields that derived, or child, tables inherit. Child tables also contain unique fields. For inheritance to work properly, a type discriminator field named InstanceRelationType of type Int64 must be defined on the root table. Child tables set the Extends property to the parent table to inherit its fields. Setting SupportInheritance to Yes on both parent and child tables enables the inheritance relationship between them.

Uploaded by

Saibabu Akkala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Table inheritance in d365

In Microsoft Dynamics AX 2012, tables can inherit, or extend, from the tables that are situated above them in a
hierarchy. A base table contains fields that are common to all tables that derive from it. A derived table inherits these
fields, but also contains fields that are unique to its purpose. Each table contains the Support
Inheritance and Extends properties, which can be used to control table inheritance.

First we need understand that when we need to apply this inheritance methodology to tables. First we need to identify
the Parent table and its siblings like

Here ‘Basic Info’ is the Parent table containing fields that are required for its child table i.e. CompnayTable and
EmpTable. And these tables have their own fields as well.Now to design a Inheritance pattern we need to consider
following important things:
 

o We can only apply inheritance on regular tables not on Temp or Memory tables

o A type discriminator field must be defined on any table inheritance hierarchy created in the AOT. The field

must be defined as an int64 type on the root table, with the name of the field set to InstanceRelationType.

o The InstanceRelationType field of the root table is read-only and stores the TableIDs of record instances; it is

populated automatically by Microsoft Dynamics AX 2012.

o Also we can only set the table properties for the table inheritance only when there are no fields in the table.

o If these requirements are not met, a compilation error will occur when the table inheritance hierarchy is

compiled.
Let create parent Table ‘BasicInfo’

Advertisements
REPORT THIS AD

Setting its SuppourtInheritance Prpoerty to Yes

When you save and compile,it will give following error


For this we need to create a discriminator; name ‘InstanceRelationType’ and of type Int64.Now I have created a field
including discriminator

Finally I have set another table property ‘InstanceRelationType’ to ‘InstanceRelationType’  field

And when I compiled, the error is gone now.

Now we have to create Two child tables

EmpTable:

First I have set the ‘SupportInheritance Property to Yes.

Now for the child table to have the parent we need to set the ‘Extends’ property of child table to parent table value like

And finally added all fields.

You might also like