Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 08:01 AM
Use
GlideSysHistoryLine
(Manually log record access)
If you want to track record access or build an audit log:
var historyLine = new GlideRecord('sys_history_line');
historyLine.initialize();
historyLine.setValue('documentkey', 'incident:' + recordSysId);
historyLine.setValue('tablename', 'incident');
historyLine.setValue('user', gs.getUserID());
historyLine.setValue('viewed', new GlideDateTime());
historyLine.insert();
Safe, auditable, and scoped-compatible.
You can query these records to build a “recently accessed” view or custom history tracking.
✅ Issue resolved? → Mark as Correct
Found value? → Mark as Helpful