Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2020 09:55 AM
I would suggest using a display business rule to do the counting, put the count in the g_scratchpad object and have the client script use that. Far more efficient to push the count to the client than have the client request the count from the server (one way trip instead of round trip.)
Avoid using GlideRecord queries on client scripts. That's been identified as a bad practice. If you MUST get dynamic data consider using GlideAjax, but this particular use case doesn't feel like that.
Example - retrieve server data using g_scratchpad | ServiceNow Docs