- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2024 11:08 AM
Can we dot walk more that 1 level using getReference in Client Script.
In my case I'm not able to do that, it is returning "undefined".
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2024 12:16 PM
You are unable to dot-walk further than just the field on the table you getting the reference from.
Any further dot-walking would instead need to be done through GlideAjax and then passed back to the client.
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-04-2024 09:08 AM
Hi all,
After doing some research I have concluded the following.
1) We can only dot walk single level using getReference function.
2) If we need to dot walk up to multiple level then we should use GlideAjax or g_scratchpad.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2024 09:17 PM
@HrishabhKumar getReference only offers single level of dot walking. For multi-level dot walks you would need to use GlideAjax and do the multi-level in Script Include instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2024 08:03 PM
g_form.getReference() function is primarily used to fetch reference field values. However, it only retrieves the value of the referenced field, not its related fields. So, if you want to access fields on the referenced record, you'll need to use additional asynchronous calls.
// Get the caller_id reference
g_form.getReference('caller_id', function(user) {
// Check if caller_id is defined
if (user) {
// Get the user's manager
user.getReference('manager', function(manager) {
// Check if manager is defined
if (manager) {
// Now, you can access the manager's email
var managerEmail = manager.email;
// You can also get manager's department name similarly
manager.getReference('department', function(department) {
if (department) {
var departmentName = department.name;
// Now you have both manager's email and department name
} else {
// Handle if department is not defined
}
});
} else {
// Handle if manager is not defined
}
});
} else {
// Handle if caller_id is not defined
}
});
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:05 AM
No it's not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:08 AM
Hi all,
After doing some research I have concluded the following.
1) We can only dot walk single level using getReference function.
2) If we need to dot walk up to multiple level then we should use GlideAjax or g_scratchpad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:35 AM
I've been looking for the answer to this question for hours. It was a hopeless answer, but I think it makes the most sense to edit it in its current form. Thank u.