How to get value of dot walking field in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2020 04:01 AM
How to get value of dot walking field in client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2020 04:06 AM
use g_scratchpad or ajax here to get dot walk field value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2020 04:08 AM
Hi,
To get values of the dot walking fields of country and city as shown in the picture using "g_form.getValue('location.country');".
In a similar way if you want to perform any action on the above two country and city fields while writing code use names as "location.country" and "location.city".
After going throw this Mark it Correct/helpful, if this helps you
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2022 11:34 AM
Really not sure why this got to be the top rated answer. It is the wrong answer. Please think carefully before posting on the Community as wrong answers can cause great confusion for newcomers.
For anyone who stumbles on this you cannot dot walk that way in Client Script.
You will either need to use getReference with a call back function
or
GlideAjax to get a reference fields related field value.
Using GlideAjax is preferable due to performance improvement (due to reduced n/w traffic being transferred) over getReference even if it uses a callback.
If the reference field you need the value for is not going to change on the form once loaded, you could also use a Display Business Rule and set g_scratchpad value there.
PS: DO NOT use GlideRecord Client Side to get reference field related field values. Trust me your instance and user base will thank you for not doing that!
Dot Walking levels: The recommended maximum is 3 although you can go deeper if you really must.
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 08:16 AM
FYI, you can use g_form.getValue("parent.child") in a client script, I do it all the time. However, the dot-walked field must be present on the form to get the value. The original poster didn't specify if the dot-walked field was present on the form or not, but I think it was assumed by the responses, and that is why the answer is correct.