- 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-30-2021 08:13 AM
Good morning
Here is the list layout and when I clicked on the parent number, it took me to the parent record.
In the child table, the Parent field is pointing to the Task table
Here is the BR:
Here is the code, could you please modify the code to see if it works so that I can learn from it.
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GldieRecord('x_531698_bod_syst_director_requests');
gr.addQuery('parent', current.parent);
gr.query();
if (gr.next()) {
current.meeting_start_date = gr.meeting_start_date;
current.meeting_end_date = gr.meeting_end_date;
current.update();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2021 09:01 AM
Your add query should be
gr.addQuery('sys_id', current.parent)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2021 10:08 AM
I'm using Script Background to test the code to see if it runs. I got the following error. What does it mean?
Evaluator: com.glide.script.fencing.MethodNotAllowedException: Function print is not allowed in scope x_531698_bod_syst. Use gs.debug() or gs.info() instead Caused by error in script at line 3 1: var gr = new GlideRecord('x_531698_bod_syst_director_requests'); 2: gr.query(); ==> 3: gs.print(gr.number); 4:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2021 10:19 AM
gs.Print(); is not allowed in scopped app.
please use gs.info(gr.number);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2021 10:22 AM
var gr = new GlideRecord('you table');
gr.addQuery('sys_id',current.parent);
gr.query();
if(gr.next()){
current.meeting_start_date = gr.meeting_start_date;
current.meeting_end_date = gr.meeting_end_date;
current.update();
}
Please try the above code