2 Replies Latest reply on Jan 25, 2014 7:51 AM by train4x4

    How do I get the last modification date and time to a file (database)?

    train4x4

      Title

      How do I get the last modification date and time to a file (database)?

      Post

           I have a file which has 4 tables and each table has a field which is named "Modified" of type "Timestamp" and option "Modification Timestamp" which automatically updates the field. In my Summary Layout I would like to show the timestamp of the last update to the file. What I think I want is the maximum value of the Modified field of all 4 tables. How to I do this? Or is there a better way to get the last modification date and time of my file?

        • 1. Re: How do I get the last modification date and time to a file (database)?
          philmodjunk

               A Maximum Summary field can show the max value of a TimeStamp Field. The context you use to reference that field will determine the total that you'll get.

               If your layout is based on the same table as where you defined these two fields, it will return the max value for all records in your current found set. If you do a Show All Records first, the field will show the value that you want.

               If your layout is based on a different table, the relationship between the two tables controls the total returned. You'll get a summary value based on what sub set of all the records in your related table are linked to the current record on your layout. If you use an X (cartesian join) relationship to link to all records in the other table, this summary field will once again give you the desired result.

               But using a relationship, here's a way that might be simpler: If you sort your records by this timestamp field, the most recent date will be either the first or last record depending on the sort order that you use.

               And for very large tables of records, you may want to set up an OnCommitRecord trigger on any layout where these records can be edited that Records the current time and date in a single record in a different table so that you do not have to sort or summarize large numbers of records. You can instead, check the value in this field.

          • 2. Re: How do I get the last modification date and time to a file (database)?
            train4x4

                 Thanks for the quick response. I tried your first suggestions and could not get it to work the way I wanted. BUT I did use your last suggestion of setting up a ONCommitRecrod trigger. It worked great, was easy to implement, and best of all, it works.  Thanks