Auto populate "Number" field from parent table to "Parent Request Number" field in Child.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2019 06:19 PM
G'day all,
I've posted this question before but couldn't get the working solution for it. To begin with, I've a form (RJ Request) which have a field "Number" as shown in the screenshot below:
Now, I want to auto populate "Number" field value onto "Parent Request Number" field of child form RJ Sub Task. Please find the screenshot below:
To serve this purpose I've created a Parent-Child Relationship b/w RJ Request and RJ Sub Task table. By creating a reference field in RJ Sub Task Table as "Parent Request Number".
But as soon as I'm creating a Sub Task I cannot see "Number" populating onto "Parent Reference Number".
Can anyone please share any solution for this.
Cheers,
RJ

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2019 08:04 PM
If you want to do it onload than you have to use client script. You cannot set value to read only field using client script.
Uncheck read only on u_parent_request_number field dictionary. than change back your business rule to below and enable client script.
change in your business rule is
var gr = new GlidRecord('u_rj_request');
if(gr.get(current.parent.sys_id)){
g_scratchpad.number = gr.sys_id;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2019 08:27 PM