Record view count - Best Approach
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2011 01:09 PM
I'm looking to have an integer that shows how many times a record has been viewed. What's the most efficient way of achieving this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2011 01:16 PM
I would create a new field (e.g. u_view_count) and use a Script Action to maintain it. The script action is triggered from an event (in this case user.view). I might recommend a filter (or some intelligence in the script action) to filter when it actually updates the u_view_count field since user.view is triggered when you view just about anything on the system.
http://wiki.service-now.com/index.php?title=Script_Actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2011 09:34 AM
This works, except I don't want the count to go up if the user the ticket was opened for views it. How can I pass or create a variable in the script actions for the current user?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2011 06:55 PM
I also need to show who viewed the record and at what time. The suggested approach doesn't seem to allow this. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2011 08:37 PM
Use a "display" business rule. The value of the When field is "display". These run before displaying a record in a form, and you have full access to "current" and can know who the user is through various gs. methods (gs.getUserID(), etc.).
--J