Create a new record in child table based on a field in parent table - can we achieve it through BR. Please suggest

Madhurima6
Tera Expert

BR to Create a new record in child table based on a field in parent table?

 

 

Thanks in Advance.

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

Hello ,

yes you can do it though a after update BR on parent table 

where you condition can be like state changes (Example)

You can specify your condition and in script you can insert a record in child table 

var gr = new GlideRecord('your_child_table_name');

gr.initialize();

gr.field_holding_parent_record = current.sys_id;

gr.insert();

Some thing like this you can do 

Hope this helps 

Mark my answer correct if this helps you

 

View solution in original post

8 REPLIES 8

Mohith Devatte
Tera Sage
Tera Sage

Hello ,

yes you can do it though a after update BR on parent table 

where you condition can be like state changes (Example)

You can specify your condition and in script you can insert a record in child table 

var gr = new GlideRecord('your_child_table_name');

gr.initialize();

gr.field_holding_parent_record = current.sys_id;

gr.insert();

Some thing like this you can do 

Hope this helps 

Mark my answer correct if this helps you

 

Yeah, tried this but it is creating 2 records in child table, When should I run this BR?

whats your requirement ?

like should it insert the record when your field on your parent table changes to some value?

The requirement is when the field on parent record changes to some value, new record in child table should get created.