5 Replies Latest reply on Jul 10, 2013 1:01 PM by liyangao

    How to automatically generate a date stamp on FileMaker 12 layout?

    liyangao

      I have a filemaker 12 database with a layout called report. I can generate a date calculated as get(CurrentDate) without the option of "Do not store calculation results -- recalculate when needed", which will give me the date the report record is created. But the report needs to be filled in by someone else and there is a Yes/No field at the end of the report for the person who filled in the report to mark whether the report is ready to be released. I want to record the date when the person actually fills in the report instead of letting the person enter the actual date for the purpose of efficiency and accuracy too.

       

      My question is how do I capture the date when the person fills in the report? If I use un-strored Get(CurrentDate), the date will be updated everytime the record is accessed, right?

      Thanks a lot for your help!

      Liyan

        • 1. Re: How to automatically generate a date stamp on FileMaker 12 layout?
          robrickard

          I have only been doing this for a few months, but i have been using the 'options' for the field under the database management (under Edit menu--> Manage). When the field is comited or changed/updated the record is then updated and this field is then time/date/stamped. A second modification field can also be added for a user to be recorded. But that will trigger for any and all fields. If it is for only one field im sure you can script something via script trigger when there is a change to then update a time/stamp field.

           

          Screen Shot 2013-07-09 at 3.59.27 PM.png

          1 of 1 people found this helpful
          • 2. Re: How to automatically generate a date stamp on FileMaker 12 layout?
            ch0c0halic

            liyan,

             

            Create a timestamp field with an Auto-Enter Calculation.

             

            Case (

            modification_timestamp = modification_timestamp

            and

            not IsEmpty ( Yes_No_field ) ;

            Get ( CurrentHostTimestamp ) ;

            ""

            )

             

            And allow the calculation to change the value.

             

            This will update every time the record is modified. When the user clicks the "Yes/No field" the result is the TimeStamp otherwise it clears the field.

             

            If you need rigorous tracking if it is switch on/off/on then I'd use a script trigger attached to the "Yes/No field" to run a script to create a logging record (in a separate logging table) as well as switching the field.

             

            BTW a simple calculation for switching between 1 and 0 is:

             

            Abs ( field1 - 1 )

             

            Examples:

            Abs ( 0 - 1 ) = 1

            Abs ( 1 - 1 ) = 0

            • 3. Re: How to automatically generate a date stamp on FileMaker 12 layout?
              BruceHerbach

              I would consider using a script and script trigger.  It sounds like you have a Yes/No field that indicates that the report is ready to be released.  Use an OnObjectSave or OnObjectModify scripttrigger.  Have the script check the value of the field.  If Yes set the time date release field with get(CurrentTimeStamp).   Your script can check to see if the timestamp field has a value already and not update.  You can also clear the value if the user changes the value of the ready field back to No.  A script and script trigger give you a great deal of flexibility.

               

              HTH

              1 of 1 people found this helpful
              • 4. Re: How to automatically generate a date stamp on FileMaker 12 layout?
                alquimby

                I would consider creating a separate table (could be named Report Readiness). The match field would be the ID to the main table. The separate table would have at least 3 fields: (1) Yes/No; (2) Creation timestamp for each related record; (3) Creation Name or Account name for person entering yes or no. This way you could track all the "no"s before the final "yes". Assuming that one final "yes" indicates the report is ready for printing, your report date in the main table would be something like Last(GetAsDate(related Creation timestamp field)). If you want the report to show date and time, just use Last(related Creation timestamp field)). Of course, you would have to put a small portal (2-3 rows) on your report layout for the data entry.

                 

                Al Quimby

                • 5. Re: How to automatically generate a date stamp on FileMaker 12 layout?
                  liyangao

                  Thank you all for your prompt replies to my question. The auto-enter calculation works for me.  At the same time, I appreciate your suggestions of a related table and script trigger. If it allows, I will mark all replies as helpful since all of them are. Thanks a lot!!

                  Liyan