Inherited fields behavior

manasa0590
Tera Contributor

Hi,

 

I have a small doubt in the behavior of the inherited fields in child table. When a table in extended , parent fields are inherited to child table. When we say so, does it mean the inherited fields are physically created in the child table or it is it just accessed through dot walking?.  I have confusion in understanding the inheritance and dot walking functionalities. Please help me clear on these topics.

 

Thank you,

Manasa  

1 ACCEPTED SOLUTION

Hi @manasa0590,

Let me try to clarify on the points you mentioned 

  1. When a table is extended in ServiceNow, only the new fields defined in the child table are physically created in the child table. The inherited fields from the parent table are not physically created in the child table, but are accessed through dot walking notation. This means that the inherited fields are still part of the parent table, but they can be accessed from the child table as if they were part of the child table. So, when you extend a parent table in ServiceNow, the child table will have its own physical fields plus the inherited fields from the parent table.

  2. The inherited fields from the parent table are accessed in the child table through dot walking notation. This means that you can access the inherited fields using dot walking notation, like this: "child_table.parent_field". However, since the inherited fields are accessible in the child table just like any other field of the child table, you can also access them directly using their field names, like this: "child_table_field_name". But it is recommended to use dot walking notation to access inherited fields, as it makes the code more readable and easier to understand.

Regards,
Shravan

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you

View solution in original post

4 REPLIES 4

Sai Shravan
Mega Sage

Hi @manasa0590,

 

 Dot walkingInheritance
DefinitionDot walking is a mechanism that allows you to access fields from related records.Inheritance is a mechanism that allows you to extend a table by adding new fields or modifying existing fields.
PurposeDot walking is used to traverse relationships between tables and to access fields from parent or child records.Inheritance is used to extend a table by adding new fields or modifying existing fields.
ExampleTo access the Department field of the User record associated with an Incident record, you can use the dot walking syntax incident.caller_id.department.To extend the Incident table by adding a new field called Priority, you can create a new table that extends the Incident table and add the Priority field to it. The child table inherits all the fields and functionality of the parent table.
Physical creationDot walking does not physically create new fields in a table. Instead, it provides a way to access existing fields from related records.Inheritance does not physically create new fields in the child table. Instead, it provides a way to access fields and functionality from the parent table.
Use with inheritanceDot walking is often used in conjunction with inheritance to access fields from the parent table.Inheritance is often used to create a hierarchy of tables, with child tables extending the functionality of parent tables.

 

Regards,
Shravan
Please mark as helpful and mark as correct solution

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you

Thank you Sai.

 

when the parent table is extended,

1. new fields of the child table are physically created or not? (in your answer it is confusing whether it is for new fields or parent fields)

2. parent fields are accessed in the child table through dot walking? or accessed just like a normal field of child table?

 

 

Hi @manasa0590,

Let me try to clarify on the points you mentioned 

  1. When a table is extended in ServiceNow, only the new fields defined in the child table are physically created in the child table. The inherited fields from the parent table are not physically created in the child table, but are accessed through dot walking notation. This means that the inherited fields are still part of the parent table, but they can be accessed from the child table as if they were part of the child table. So, when you extend a parent table in ServiceNow, the child table will have its own physical fields plus the inherited fields from the parent table.

  2. The inherited fields from the parent table are accessed in the child table through dot walking notation. This means that you can access the inherited fields using dot walking notation, like this: "child_table.parent_field". However, since the inherited fields are accessible in the child table just like any other field of the child table, you can also access them directly using their field names, like this: "child_table_field_name". But it is recommended to use dot walking notation to access inherited fields, as it makes the code more readable and easier to understand.

Regards,
Shravan

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you

Great! this exactly answers my doubts. Thank you Sai.