1 Reply Latest reply on Dec 26, 2012 11:55 AM by philmodjunk

    Detailed Timestamping



      Detailed Timestamping


           I know the basics of how to use timestamps.  However, I'm trying to come up with a more detailed approach.  For example, I'd like a portal that dispalys ALL changes to a record and who made them.  If someone changed the spelling of a contact's name, I want to see a log of this, and so on.  Is this at all possible?


        • 1. Re: Detailed Timestamping

               It is possible with a lot of script triggers, careful scripting and a related table to use to log all such changes and the account name of the person that changed them. (If necessary, an account name can be used to pull up a user's full name from a  table of account names if you create and maintain such a table in your database.)

               The basic approach that I've used is to put this script on the OnObjectEnter trigger for all fields on the layout where you want such change by change tracking:

               Set Variable [$$OldValue: Value: Get ( ScriptParameter ) ]

               You then refer to the field's value in the optional script parameter box for the script trigger. If your field were named DataTable::TextField, then you'd use DataTable::TextField as the parameter passed to the script. (This works even with popup menu fields.)

               Then I set up a script with the OnObjectSave trigger that appends the Contents of $$OldValue to a list of such changes.

               Set Variable [$$ChangeList ; List ( $$ChangeList ; Get ( ActiveFieldName ) & "|" & $$OldValue ) ]

               You can also put the value in one list and the field names in another.

               Then use OnCommitRecord to perform a script that takes the data in $$ChangeList and log it in a new related ChangeLog Record. Fields in ChangeLog can auto-enter the account name and creation timestamp.