AnsweredAssumed Answered

Relationship for access log

Question asked by JasonPierce on Jul 1, 2016
Latest reply on Jul 1, 2016 by JasonPierce

I have a table that I want to monitor and audit read-only access to records. The Data table has a unique Key field for each record and I'm creating the relationship to my AccessLog using this field. I have an "onRecordLoad" script trigger on the layout that does a setfield on the AccessLog table using the Data table Key as calculation being set. This is obviously not the correct relationship or method to be using here because my AccessLog table gets an updated timestamp on the same record each time a Data record is re-opened. What I'm wanting is a new AccessLog record each time that a Data record is re-opened. I've tried creating an additional requirement for the relationship with the Data table's CreationDate and the AccessLog's timestamp, but this did not force a new record creation either.


What do I need to do to make this relationship work like I'm wanting?



===== SOLVED ====

I added a calculation field to Data that does a Get( CurrentTimeUTCMilliseconds ). I changed the relation to be Data Key to AccessLog RelatedKey fields and Data CalculatedTime to AccessLog timestamp field. This seems to give me a new AccessLog record for each view of a Data record.