- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 04:47 AM
I am stuck on one issue in catalog client script. I have one variable that referring table A, and in table A there is another reference filed that referring table B, so I want to Auto populate table B data in my other variable. I have wrote one catalog client script but not working. For example i have below code--
g_form.getReference('variable_name', function (DataAsset)) {
g_form.setValue('form_field_name', DataAsset.a_table_field_name.b_talbe_field_name);
}
When I have checked with alert function, it giving me undefined value.
Please help on this. Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 05:07 AM
Double dot walk does not work in client script.
Also getReference is not best practise, use glide ajax, you can do any level dot walk in script include as it is a server side script.
Please mark this helpful/correct accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 04:57 AM
Hi,
In Client Script you can just do a single dot walking to do a multiple dot walking you need to write a GlideAjax and Script Include.
Please go through the link for more info : https://community.servicenow.com/community?id=community_question&sys_id=83a904551b838050fff162c4bd4b...
Please Mark it as correct if its helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 05:01 AM
Hi Brijmohan
Double dot-walk will not work in client scripts.
you should use glideajax and get the value
Adding few links below , you can try and let us know if you're stuck.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 05:07 AM
Double dot walk does not work in client script.
Also getReference is not best practise, use glide ajax, you can do any level dot walk in script include as it is a server side script.
Please mark this helpful/correct accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2022 02:30 AM
Please mark the relevant answer correct to close the thread
