Five Simple steps to carry out Table Inheritance in AX 2012
Step 1: Create a table(Ex Parent Table) and set the support inherence property to ‘YES’.
Step 2: Create a field by name ‘InstanceRelationType’ of type INT64
in parent table and this field should
extend an EDT ‘RelationType’.Now create any other field you want(Ex: Id,
Name).
Step 3: Set the ‘InstanceRelationType’
property of parent table to the field ‘InstanceRelationType’ and save it.
Step 4: Now create another table (Ex: child table) and set the support inherence property to ‘YES’ and
the extends property to base
table/parent table.
Step
5: Now when you insert the record in child table,
the same record gets defaulted in parent table due to table inheritance
property set to YES. You can also write a job to insert data in child table and
check the parent table weather records are defaulted or not.
Note:
- In the above scenario the ‘parent table’ will be physically present in the back-end database, but the child table will not be present in the back-end database, because it is just the virtual existence of parent table.
- When you create any new/existing fields in child table, that field won’t be visible in parent table in AX client. But if you see at the back-end (Sql server management studio) the parent table would have the record that was created in child table. The reason for this is child table is just a virtual existence, it isn’t present physically.
No comments:
Post a Comment