3 Replies Latest reply on Sep 26, 2013 10:21 AM by jdanniel

    Auto-Entering Date

    jdanniel

      Title

      Auto-Entering Date & Time and Then Creating a Go To Last Record Button

      Post

           Hello, I am using Filemaker Pro 12.4 Advanced.  I have a question about creating a button for an auto-generated timestamp field.

           I’ve figured out how to create a field that auto-generates a date and time.  I’ve also figured out how to add the field to my form layout.  The name of the field is Timestamp.

           I want to create a button that takes me to the very last record I ever entered.  I created a button and set it to Navigation/Go to Record/Request Page and set the option to Last.  I am assuming I need a timestamp for this, which is why I created that field.  If I am wrong, and this is not necessary, by all means, please let me know.

           The problem with the button is that I’ve sorted the list, and prefer to keep it sorted.  It is sorted by Customer Last Name. 

           So, I need to learn how to create a button that goes to the last record created, regardless of how the database is sorted.  Do I need a timestamp field for that, or is there another way to do this?

           I want a timestamp on my form regardless, though, so can I please get help auto-entering it so that it will appear in previously entered records?

           Thanks for reading this, and any help is sincerely appreciated.  Thank you!  Jack D.

            

        • 1. Re: Auto-Entering Date & Time and Then Creating a Go To Last Record Button
          jdanniel

               I think I figured it out.   I created a script that sorts the records by timestamp, then goes to the last record.  I then created a button that runs that script.

               I'm pretty sure it's working correctly, but I'm going to have to make a set of dummy records to test this out more thoroughly.

               While I was at it, I also created a second script that sorted the records by Customer Last Name again, and created a button for that.

               Quite simple, actually.  I wish I had thought of all this before posting the question!  But that's how you learn, I suppose.  

               If the buttons do not work correctly, is it all right if I come back and ask for help?  I'm pretty sure they're working though.  Jd

          • 2. Re: Auto-Entering Date & Time and Then Creating a Go To Last Record Button
            philmodjunk
                 

                      but I'm going to have to make a set of dummy records to test this out more thoroughly.

                 You may have already thought of this, but make a copy of your file for testing purposes. Then, when you are through testing, you can discard that file and revert to the original. That way, you don't have to worry about removing any dummy records from your table while leaving the original data intact.

                 Here's other code you could put in a script that also reliably takes you to the most recently created record:

                 Show All Records
                 UnSort Records
                 Go to Record/Request/Page [Last]

            • 3. Re: Auto-Entering Date & Time and Then Creating a Go To Last Record Button
              jdanniel

                   Made several copies, yes.

                   And thank you for your version of the script.  I need to use scripting more often.  It really helps automate various tasks!  Thanks again.  Jd