- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 06:07 AM
This is the script that I am using to populate Vendor name from parent to child record that I am creating from related list.
function onLoad() {
//Type appropriate comment here, and begin script below
var r = g_form.getReference('parent', callBack);
}
function callBack(r){
g_form.setValue('u_vendor', r.number);
g_form.setValue('u_vendor_display_name', r.u_vendor_name);
}
Number is getting populated but for Vendor name it is showing value as undefined.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 12:20 AM
Hi,
why not show those fields as dot walked field on customer record instead of creating new 2 fields to hold it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 06:17 AM
Hello,
Please check the spelling of the field name (u_vendor_name) and double check the value of the custom vendor name field on that particular record.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 09:27 PM
Hi Allen,
Thank You for your reply. I have checked, the spelling and the Values of fields are correct.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 09:34 PM
Are your fields parent, u_vendor and u_vendor_display_name fields all on the same form(not in related list).
If not, the client script will not work.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 09:56 PM
Yes, they are on same form. Only (u_vendor_name) field is on parent form. Trying to take the String value of u_vendor_name from parent record and trying to populate it to u_vendor_display_name field in child record.