1 Reply Latest reply on Nov 5, 2013 9:44 AM by philmodjunk

    Prevent users creating blank records

    ChrisJones_1

      Title

      Prevent users creating blank records

      Post

           Hi 

            

           Does anyone know a way of preventing users creating blank records and leaving gaps in a sequence of serial numbers? For example the user opens a layout and selects new record (record number 50) but then realises they have selected the wrong layout and exits the layout thereby leaving the record blank. The next user opens the layout and another record is created ( record number 51) but this leaves the previous record (record number 50) blank. 

            

           Is there someway I or FM  can either, prompt the user to fill in all the required fields or, better still, exit the layout without creating a record leaving the serial numbers in sequence? I have looked at Serial Number | Generate | On Commit rather than On creation but FM still creates the record with the serial ID. I have trawled the forums and I can’t seem to find anything that really does what I want it to do, so any help would be appreciated.

        • 1. Re: Prevent users creating blank records
          philmodjunk

               Why is a gap in the serial number significant?

                

               It's possible to roll back a next serial number value via script, but in multi-user environments, this can be very difficult to do as other users may also be creating new records at the same time.

               It's much easier just to delete the blank record, ignore it, or don't issue the serial number until all validation requirements are met.

               To delay issuing the serial number, you can select the On Commit option provided that you:

               a) design the layout to keep the user from committing the record by accident. Clear the "auto-save" option in Layout setup. Cover the layout background with an empty, invisible web viewer to intercept all mouse clicks of the background. Do not allow access to layout controls for changing records or layouts except for those you put on the layout for this purpose that will not take the user to a new layout or new records without first doing the steps shown in b). That will include hiding/locking the status toolbar and a custom menu that omits these menu options or replaces them with your own scripts. (Requires FileMaker Advanced).

               b) Add a button on the layout that performs a script that first validates the data entered (record is not blank in your case) and then commits the record.

               Another option is to use a layout with nothing but global fields on it for creating the new record. The user fills in the global fields and clicks a "save" button to save the data. The save button's script does the same steps as b) above but also creates a new record and copies the data from the global fields to corresponding nonglobal fields in the new record.

               c) By using a related table to generate serial numbers. Such can be generated "on demand".