shubhamseth
Giga Sage

@SoniShaily 

 

 

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