- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 02:02 AM
Hi
I have a requirement , where I have a table (Control Objective)- parent, and this table (Control Objective) has a related list in which there is same table Control objective - child...
so when i create a record from the related list (child record) , the fields should be auto filled for the child record..
How can i do it .
can anyone help me on this
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 02:53 AM
you can use display business rule on the child table and use the parent field to auto-populate fields
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.parent){
current.fieldNameOnChild1 = current.parent.fieldName1;
current.fieldNameOnChild2 = current.parent.fieldName2;
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 02:53 AM
you can use display business rule on the child table and use the parent field to auto-populate fields
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.parent){
current.fieldNameOnChild1 = current.parent.fieldName1;
current.fieldNameOnChild2 = current.parent.fieldName2;
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 02:59 AM
Hi @Ankur Bawiskar
It worked thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 03:00 AM
Glad to know.
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 03:28 AM
Hi @Ankur Bawiskar
There is one more requirement, can u plz help me that
say i create this Control objective record by filling all the fields, then i update the parent filed( this parent field will have same fields- So i have to populate the same thing into new record which i just created ), so basically the desc and short desc will have the values of the parent record.
Requirement
. From Table view
- The user creates a new Control Objective via new button on the table.
- Selecting existing Control Objective in the field "Parent"
Expected behavior: short desc / desc of a parent Control Objective will be populated into the filed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 03:56 AM
Script I shared should help
what's the challenge?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader