I use 2 fields (nearly) every table, some linking (many to many) tables do not have this. [Table]Created_Who [text] [Table]Modifed_Who [text]
both fields track the same info Current User, Date, time (in that order and that format) This info is updated, most often by a trigger, using the Database Events. I also have a separate table for specific action(s) I want to track (ex: deleting a record, user created some specific type of record, user logged in etc). In this table I track basically the same information as above (in a different manner) as well as what the action was. For Record deletions, I track the table, and original record ID and I convert all the data of the record to text (I do/can/will/would lose blob and pict data, however, not an issue at the moment) and save the text of the deleted record data in the record with the tracked action. For the tracked actions I use another table, to hold the actions I want to track. On Tue, 20 Nov 2018 13:59:36 -0600, Robert ListMail via 4D_Tech wrote: > At a minimum, I just have the simple need of recording “CreatedBy” > and “ModifiedBy” values (username or ID) for one particular table. > I do have extra fields already in that table that could be repurposed > and I would probably add “DateModified” to that. However, that’s > three fields used just for auditing. When I look back at previous > posts I see that some of you are tracking (saving audit data for) for > tables and even individual fields. So, as I have a chance to redesign > this DB, I wanted to re-think how this is implemented. > > > So, Chip, when you have the need to store the username (or ID) of the > user that created and/or last modified a key record, do you ever have > this data in the field of the original record? I’m sure I have seen > this more commonly where the data is in the original record. I guess > to keep things normalized, you would use a related table (or a > standalone table) where each transaction that you want to remember is > stored. However, with the separate table method I suppose you would > have to search this audit table every time your detail form is loaded > (assuming you want to show who created or modified a record) and that > each time the record is updated the audit table would be getting a > new record. > > Thoughts about your data audit strategy are appreciated. > > Thanks, > > Robert > > ======================= > Robert Broussard > Houston, TX > ======================= > >> On Aug 26, 2015, at 9:26 AM, Chip Scheide >> <[email protected]> wrote, Re: Triggers and error handling: >> >> so my triggers tend to look like this: >> case of >> (Database event = : (Database event=On Saving New Record Event) >> trk_Last_Modified (->[Account_Postings]Created_Who) >> trk_Last_Modified (->[Account_Postings]Modified_Who) > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** --------------- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

