when should i use dot walking and when should i use gliderecord in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 12:14 AM
when should i use dot walking and when should i use gliderecord in client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 12:26 AM
Hi there,
Basically you should never use GlideRecord in Client Script. Just bad practice.
Maybe this is some interesting reading for you:
2020-01-10 Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 03:27 AM
Hi SNOW,
As Mark replied, it's a bad practice to use GlideRecord() or reference() in client script because of performance. It's better to use GlideAjax to call Script Include function asynchronously.
It's not recommended to use GlideAjax in onSubmit() scripts because the script will continue execution and submit the form before returning a value. In this case, it's better to redesign to check a field in onChange() or fill other variable in a business rule.
Instead of dot-walking on client script, use g_scratchpad in display business rule or get the value in a GlideAjax call script include.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 06:47 AM
Hi there,
Any follow-up needed? Or was my answer sufficient?
Let me know.
If your question is solved, please close the topic by marking my answer as correct. This will help others searching for a similar question and will remove the topic from the unsolved list.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2022 09:53 PM
Hi there,
Any follow-up needed? Or was my answer sufficient?
Let me know.
If your question is solved, please close the topic by marking my answer as correct. This will help others searching for a similar question and will remove the topic from the unsolved list.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field