Populate field value from a dot walked field on another table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:42 AM
HI Guys,
I need to Populate field value from a dot walked field on another table.
I'm trying to create a client script on the task table.
I need to stamp in the u_managing_agent value on all tasks and that information comes from the company field that is referencing the customer_account table and the value needs to be from the account_parent field in that table.
This is what I have so far,
onChange script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var mAgent = g_form.getValue('company');
if (mAgent == '');
g_form.setValue('u_managing_agent' , 'customer_account.account_parent');
}
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:44 AM
Hi,
You cannot do dot walk like this, Either use GlideRecord or getreference or GlideAjax. Best is to use GlideAjax and you will find any many sample code for your reference. Mark my answer as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:47 AM
Thanks, Musab,
I'm new to scripting so could you assist me with that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:45 AM
You cannot dot-walk in client script.
You will have to use a GlideAjax and call a script include for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:50 AM
Hi,
why not show the dot walked field on form layout itself?
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader