- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2021 01:56 PM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2021 11:11 AM
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);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2021 02:17 PM
Use an after insert/update business rule on the parent table that does a gliderecord query to lookup the child record and updates it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2021 02:21 PM
Hi, As Brian indicated you would use an after business rule to update the child record once the parent record values have been updated/committed to the database.
This will require a glide query to find the child record(s) and you can then set the child values based on 'current' values and would be something like (untested)
var gr = new GlideRecord('yourTable');
//Normally only active children would be updated
gr.addActiveQuery();
//Assumes the 'parent' field is on the current record and a relationship to the children
gr.addQuery('parent', current.sys_id);
gr.query();
//Now itterate through all child records
while(gr.next()) {
gr.yourTargetField1 = current.yourSourceField1;
gr.yourTargetField2 = current.yourSourceField2;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2021 02:23 PM
Write a Before Insert BR as below.
var gr = new GldieRecord('child_table');
gr.addQuery('parent',current.parent);
gr.query();
if(gr.next()){
current.start_date(date field on Child table) = gr.start_date;(date field on Parent table)
current.end_date(date field on Child table) = gr.end+date;date field on Parent table)
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2021 02:55 PM
I'm really sorry for not being clear. I need to trigger a business rule when there is an insert/update on the child table. Then copy the values from the parent to the child table.