Modify Related List New Button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 12:24 PM
Hi all,
I have a Parent Form A and a Child Form B.
The Child Form is connected to the Parent Form through a Related List on the Parent Form.
When a user clicks on New on the Parent Form within the Related List, they are redirected to the Child Form.
I would like to modify the New Button on a Related List such that when it is clicked, several fields on the Child Form are autopopulated based on the Fields from the Parent Form.
How should I go about this?
Any help would be greatly appreciated, thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 12:45 PM
Hello @Rae Khan ,
You can create a onload client script on form B table to autopopulate fields. See the below example:
function onLoad() {
//Check if the form is a new record
if (g_form.isNewRecord()) {
var parentRec=g_form.getReference('parent',test); // instead of parent you can use appropriate field which is pointing to record from form A.
function test(response)
{
g_form.setValue('short_description', response.short_description); // using this you can set multiple fields from form A
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 01:14 AM
Hello @Rae Khan ,
Does this resolved you issue ? If yes, It would be great if you mark my response as CORRECT or Helpful so that others can see this on top of the list and get benefited by this.
Thanks & Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 01:15 AM
Hi @Rae Khan
You can check the logic of change and change task. OOTB UI action is there.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************