Parent - child relationship between custom tables

G Balaji
Kilo Guru

Hi,

I've a custom table "Profile" that extends OOB task table. There is another custom table "Profile tasks" that extends "Profile" table. I've created "Profile tasks" to save the tasks created for the records in "Profile". 

I'm not sure how to set up a parent-child relationship between these tables, Parent(Profile) table and child(profile tasks) table. 

For every record created in profile table, associated tasks has to be created in "Profile tasks" table.

Could somebody set up pointers to this?

Thanks.

8 REPLIES 8

Thanks for the response, Jim.

I understood your point except for the following.

Could you please help me understand why extending a table does not give logical Parent/Child relationship. Of course, I understand in implementation perspective, just extending a table does not give logical parent/child relationship but by defining relationship in sys_m2m table. However, why doesn't it give logical parent/child relationship?

Extending the Profile table does not give you a logical Parent/Child relationship, but more of a different "type" of Profile.   Just like how Incident extends the Task table, it created a different type of Task.

Is there any ways to editing "Profile tasks" table's extends from field to "Task" without deleting the table or using background scripts? Because the table has been created, it doesn't allow me to change extends from field to Task now.

 

Yours was brilliant perspective.

Thanks again.

Extending a table from another does give it a parent/child relationship in terms of the table hierarchy.  Think of Incident extending from Task.  Now those Incidents are just a specific type of Task, and will show up in a list of all Tasks.

If you want to create a virtual parent/child relationship, you can do that with a Reference field on the child table pointing to the parent table.  Like Requests and Requested Items.  The Requested Items table has a "Request" field pointing back to Request.  You can have multiple Requested Item pointing back to Request.  Both of those tables extend Task because they are types of Tasks to be completed.

Unfortunately, I don't think there is a way to change a table's "Extends from" field.  Are there a lot of custom fields on your Profile Task table?  Also, is the "Profile" table really a type of Task?  In other words, should "Profile" be a brand new table on its own, and "Profile Task" be an extension of Task?

 

A "Profile" need not be a task.  My workflow which is running on "Profile" table has tasks to be completed by the user. That's the only reason I extended task table while I created "Profile". 

And "Profile Task" table will have records created from workflow tasks.

Now "Profile Task" table only has fields from "Task" and "Profile" table. There's going to be only one custom field ie. to add a reference field to "Profile" table. 

Thanks for the response.

Jim Coyne
Kilo Patron

Remember to mark any answer/comment as being the correct answer or helpful.  Thanks.