Capture Parent ID in Child Record created from Related Lists

John Prouty
Kilo Guru

I have a child table that is on the parent's form as a related list.  When I click "New", I want the key of the Parent record currently displayed to be displayed/stored on the child record.  How do I get the parent's sys_id into the child record?

1 ACCEPTED SOLUTION

Even with custom tables this will work.

Take the following example relationship:

find_real_file.png

On the 'My Custom Table' record you have a related list and that related list's name is My Custom Child Table > My Custom Table

When you click new in the related list, the Parent field on the My Custom Child Table will automatically be populated.

To see an example of this in an OOTB incident record, select the 'Child Incidents' Related list and click New. On the record that shows up, you'll see that the 'Parent incident' field is pre-populated with parent record you've just come from.

find_real_file.png

 

find_real_file.png

As I said above, this is just standard functionality across the platform, regardless of whether you are using custom tables or not. Full documentation on Related Lists can be seen here.

Callum

View solution in original post

5 REPLIES 5

Callum Ridley1
Tera Guru

This is default functionality on the platform, you shouldn't need to do anything. Check the related list to see what field the relationship is based on, that field will automatically populate on the new child record. 

The only exception to this is where the relationship is a custom relationship.

John Prouty
Kilo Guru

I am using custom tables.  How do I do it, since I am using custom tables?

 

Even with custom tables this will work.

Take the following example relationship:

find_real_file.png

On the 'My Custom Table' record you have a related list and that related list's name is My Custom Child Table > My Custom Table

When you click new in the related list, the Parent field on the My Custom Child Table will automatically be populated.

To see an example of this in an OOTB incident record, select the 'Child Incidents' Related list and click New. On the record that shows up, you'll see that the 'Parent incident' field is pre-populated with parent record you've just come from.

find_real_file.png

 

find_real_file.png

As I said above, this is just standard functionality across the platform, regardless of whether you are using custom tables or not. Full documentation on Related Lists can be seen here.

Callum

John Prouty
Kilo Guru

The "trick" is that the parent reference field must be called "Parent", or the automatic referencing doesn't work.