4 Replies Latest reply on Oct 25, 2011 7:04 PM by dave_1

    The best way to create a record

    dave_1

      Title

      The best way to create a record

      Post

      I am working on a system that provides the user with a screen of information to fill in, and then I record it in the database (yes, thats what we all do I hear you saying!)

      My question relates to the best way to create that record.

      By default FMP records each value as you move from field to field, so hypothetically if you had 20 items that needed to be filled and the user stopped at 11 items, FMP would have stored all the values for you.

      I would prefer to have all the data stored at the record level at once rather than the field level as you pass from field to field via a 'Im finished record my data' style button.

      What is the best way to have FMP do this?

      In the example above, if the user leaves the screen with only 11 of 20 items filled, Id love to pop a message box that says moving away from the screen will lose the information, but I am not sure on exactly how to go about this.

      Any help would be greatly apprecated.  Thanks!

        • 1. Re: The best way to create a record
          Sorbsbuster

          A common practice is to have the 20 data entry fields as global fields, then have a 'Commit Record' button as you suggest.  The script on that button checks anything about the 20 fields you want to verify, then creates a new record and slots the global data into the 'real' fields.

          • 2. Re: The best way to create a record
            philmodjunk

            Nothing wrong with Surbsbuster's solution. There is an alternative you can also do that requires less scripting but it relies on a rather odd layout design trick to make it work.

            In layout setup... you can clear a check box to disable "auot save". With this box cleared FileMaker will ask permission before saving changes to a record. If you then place an empty web viewer layout object  on your layout so that the body is fully covered by it, then place your fields and other layout objects on top of this viewer, it will intercept any mouse clicks on the layout back ground to keep them from triggering the dialog that asks if the user wants to save the record. This web viewer object can be made invisible by selecting transparent patterns or zero width borders. With this layout design, you can add a pair of buttons, one to commit the record and one to use revert record to discard the data entry.

            • 3. Re: The best way to create a record
              dave_1

              Thanks guys - ill try both and let you know what I find works best for me.

               

              Cheers!

              • 4. Re: The best way to create a record
                dave_1

                Both of these worked, but I just found for what I was doing that having the global fields made things a bit easier.  Thanks for both the suggestions though.