- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 11:42 PM
Hello,
The following script is working fine in Scripts Background. However, when I put it in onChange, it returns "0" record.
Please let me know what I did wrong? Thank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 07:40 AM
Hi @Jessica28 ,
Example:
Script include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 11:45 PM
Hi,
As a developer, we should avoid using “GlideRecord” in the client script. Try using server side scripting for gliding the records.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 11:47 PM
Hello @Jessica28 ,PLEASE DONT USE GLIDE RECORD API WHICH IS A SERVER SIDE API IN CLIENT SCRIPTS
i would suggest you to call a script include and pass the value of who_is_this_request_for value as a parameter to the function and perform the glide record over there and then return the count which should work easily.
Hope this helps
Mark the answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 11:58 PM
Its Not good practice to use glide record to client side instead of that you can use script include and to call it client side use glide ajjax

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 12:01 AM
Hello @Jessica28 ,
Its not recommended to server side script in client side. you can use glide ajax instead. Refer this thread to understand how to utilize Server side script at client side. GlideAjax Example Cheat Sheet Video Servicenow GlideAjax Script Include Example
Kindly mark correct and helpful if applicable