How can I add the user ID to the activity log stamp in a record?

apriled
Tera Expert

I would like to add the userID in parentheses next to the username in the Activity Log when a record is updated.

AddUserID2ActivityLogStamp.jpg

1 ACCEPTED SOLUTION

Ok, figured it out.



The Activity formatter is pulling from the History [sys_history_line] table, which stores the audited changes (actually copies them from the audit table on-demand, but no need to get into that here), and it stores the value of a user's name field ([sys_user].name) in a string value called user_name on the History table.



All you need to do is edit the calculated value on the dictionary entry for column 'name' on the table [sys_user] to show the userid you want displayed.   I've (actually) tested this time, and it works.



**Keep in mind that this will not affect existing entries in the History table, those strings have already been written from the previous user name values.   However, you can clear (delete) the existing records from the History table and they will be regenerated from the audit table records.   So unless you clear the history table to have it rebuild the history lines, you will see the previous values (name only) for existing entries, and the new values (name + userid) for new entries.




-Brian




Edit:   To clear your history entries requires clearing two tables:   [sys_history_line] and [sys_history_set].   The easiest way is to open each from the "Tables" module, and then click the button "Delete All Records".


View solution in original post

10 REPLIES 10

Dear 

 

Could you please help me by images?