2 Replies Latest reply on Jul 1, 2016 10:29 AM by JasonPierce

    Relationship for access log

    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.

        • 1. Re: Relationship for access log
          coherentkris

          onRecordLoad will fire via user navigating through a foundset with the navigation buttons.

          It will also fire anytime a script performs a navigation step and a record is loaded.

           

          What value is tracking record reads?

           

          Just curious.

           

          Seems like addition of a huge ammt of overhead.

           

          Also can you please define "re-open"

          • 2. Re: Relationship for access log
            JasonPierce

            coherentkris wrote:

             

            onRecordLoad will fire via user navigating through a foundset with the navigation buttons.

            It will also fire anytime a script performs a navigation step and a record is loaded.

            That is precisely what I'm after.

             

            What value is tracking record reads?

             

            Just curious.

             

            Seems like addition of a huge ammt of overhead.

            We have a corporate policy for this particular data set that requires being able to identify who has read into certain records. There will not be a whole lot of activity in this database so overhead should not be an issue.

             

            Also can you please define "re-open"

            If the user navigates away from Data Record A, through Record X Y and Z, then back to Record A (re-opening Record A), I need a new timestamped AccessLog record created.