How to copy fields value from Parent to Child form?

Erica2
Tera Contributor

Hello everyone,

My use case is in my parent form, I have meeting start and end date fields where the end user select the dates. 

I also have the same fields in my child form.  How do I copy the start and end date from the parent to child form when the record is insert or update so that those dates will show up in the child form as well?

Thanks

 

1 ACCEPTED SOLUTION

try this is scripts background.

var gr = new GlideRecord('x_531698_bod_syst_director_requests'); 
gr.addQuery('sys_id', 'sysid'); //repleace sysid with a sysid from one of your parent records.
gr.query();
if (gr.next()){
   gs.info(gr.number);
}

View solution in original post

19 REPLIES 19

Best practice is to never user current.update(). Note that this is a before BR so the update statement is not required.

@Brian Lancaster ,

current.update() is only use on "after" BR is that right?

 

How about the current on meeting dates.  I can use it there right?

current.meeting_start_date = gr.meeting_start_date;
current.meeting_end_date = gr.meeting_end_date;

If the BR is running on the table you are updating you should use a before BR. Using current.update will cause all other BRs to run and you could get caught in a loop. Current on any field is fine you just don't want to use current.update to update them for the reason stated earlier.

try this is scripts background.

var gr = new GlideRecord('x_531698_bod_syst_director_requests'); 
gr.addQuery('sys_id', 'sysid'); //repleace sysid with a sysid from one of your parent records.
gr.query();
if (gr.next()){
   gs.info(gr.number);
}

Erica2
Tera Contributor

Finally got it to work. Couldn't have done it without all your help. Thank you so.......... much everyone!