5 Replies Latest reply on Nov 24, 2012 8:58 AM by philmodjunk

    Restricting number of records

    MaxwellRobin

      Title

      Restricting number of records

      Post

           Hi all!

           i have a table that I would like to only have one record in it

           the user cannot add or delete records and there should always be only one record in the table.

           is this possible?

           thanks

        • 1. Re: Restricting number of records
          RickWhitelaw

               I'm on an iPad and don't have access to the proper syntax, but this can be done with validation.  If(Count) . . .  Look it up.

          • 2. Re: Restricting number of records
            Abhaya

                 yes,

                 Just hide and lock status tool bar.

                 Add one additinal condition in the script where the user wants to add new record

                 if count(tables PkID)=1

                 then exit script

                 else

                 show message "User can't add more than 1 reocrd into this table"

                 end if

                 Hope it will work at your end.

                  

            • 3. Re: Restricting number of records
              philmodjunk

                   The count function won't count the records in your table with that syntax.

                   In FileMaker advanced, you can install a custom menu for the layout for that table where you have removed the New Record menu option.

              • 4. Re: Restricting number of records
                MaxwellRobin

                     yes i know that but its only one layout where i would like to limit the number of records not my whole document and the rest of my tables.

                     can i have a script run on layout entry that creates a record if there are none and then one on record creation that checks to see if there are more than one records and then deletes the created record?

                      

                     thanks

                • 5. Re: Restricting number of records
                  philmodjunk

                       Only from certain layouts will a user be able to create new records in a specific table. Unless the layout is based on an occurrence of that table or has a portal to that table--which makes no sense if you want to limit it to one record, they will not be able to create additional new records in that table.

                       If you do have multiple layouts based on this table, you can install the same custom menu on all of them.