
- 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:03 PM
ok, Is parent field populated once the form is loading?
u_vendor_name is a string field as well and also u_vendor_display_name ?
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 10:34 PM
yes, it's populating and both are string fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 09:41 PM
Hi,
client script is on which table?
Are you sure parent field is populated on form? parent field is present on form view?
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:03 PM
I have created a vendor record from which I am creating a customer record through related list. In customer form I have created a reference field (u_vendor) taking reference from Vendor table in which I want to autopopulate the vendor record number for eg. VEN0001004 when I create a new record using related list and vendor name from vendor record should also autopopulate on the customer record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 10:15 PM
Hi,
then why not use display business rule on customer table and do this
current.u_vendor_display_name = current.parent.u_vendor_name;
current.u_vendor = current.parent.number;
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader