OnLoad Client Script not working on Employee Center form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 09:12 AM
Hello,
We have just recently implemented the Employee Center and so far everything is going smoothly except for one form I can't quite figure out how it didn't make the transition. This client script is supposed to populate a field with values from the table this Record Producer is tied to, but it is coming out blank. See screenshots attached for script and Employee Center form. The form is working fine in Service Catalog.
Any help you offer would be greatly appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 10:09 AM
You are using gliderecord in your client script, it won't work. You need to use either GlideAjax or g_form.getReference with a callback.
https://servicenowguru.com/scripting/client-scripts-scripting/gform-getreference-callback/
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2023 10:48 AM
Hi there,
This might help you:
- 2020-01-10 - Article - Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field