Enter the key words to find the related topics

Showing posts with label Table property : Support Inheritance. Show all posts
Showing posts with label Table property : Support Inheritance. Show all posts

Table properties : Support Inheritance

Support Inheritance:
Default value : NO
 Properties Abstract and Extends will be disabled when Support Inheritance is NO.
To create an Inheritance Parent table (Base table) we need to follow below steps:
  • Int64 field 
  • Field name as InstanceRelationType(Parent table)
  • Extends with RelationType.
  • Support Inheritance Property to YES
To create an Inheritance Child table (drived table) we need to follow below steps:
  • Support Inheritance Property to YES
  • Extends Property to the Parent table
(In AX 2012 we need to create a field and set the property to InstanceRelationType to InstanceRelationType field whereas in D365 creates the field automatically when we set Support Inheritance to YES).

IS and AS keywords are used for Inheritance.

Whereas IS keyword is used whether an object is a subtype of a specified class/Table.

AS keyword for assignments that downcast from a base class variable to a derived class variable.

Abstract versus concrete tables:

Tables in a table inheritance hierarchy can be defined as either abstract or concrete, depending on whether the table property Abstract is set to Yes or No. Records can only be created for concrete table types. Any attempt to create a record and insert it in an abstract table will result in a run-time error. The position of the table in the inheritance hierarchy does not restrict its ability to be defined as abstract.

(If Abstract property set to YES, we can't create the records in the parent table.)