
- 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 10:54 PM
WHat is the value of "u_vendor_name" in parent record, share the screenshot
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 11:05 PM
Hi,
So Vendor Name is u_vendor_display_name?
What is Vendor field on right side
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 11:42 PM
Yes, Vendor Name is u_vendor_display_name.
Field on the right side is vendor(u_vendor) which is a reference field.
I tried to bring the Vendor. Vendor Name(u_vendor_name) from form layout and tried to autopoulate it with u_vendor_name from parent but it is also not working but when i am changing record in vendor field then it is populating with the value of that vendor record.
- 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 10:27 PM
You can try below
g_form.setValue('u_vendor_display_name', r.u_vendor_name.getDisplayValue());