4 Replies Latest reply on Jul 17, 2011 4:41 PM by JB

    Turn off automatic new blank record creation in portal

    JB

      Title

      Turn off automatic new blank record creation in portal

      Post

      Hello all

      I have a portal that works just fine.  I just want to somehow turn off the automatic record creation that seems to happen every time the user clicks in the last record.  I want the user to not have to see a new, blank record unless they click a button with a create new portal row script attached to it. 

      Can't seem to figure out how to turn off the automatic record creation, but I know it is possible. 

      Thanks!!!!!!

        • 1. Re: Turn off automatic new blank record creation in portal
          bumper

          Go to Manage > Databases > Relationships 

          On the TO in question, double click the relationship box and under the field names will be a check box with the following "Allow creation of records in this table via this relationship." Uncheck the the check box. Close and Save. 

          • 2. Re: Turn off automatic new blank record creation in portal
            JB

            Bumper, thanks very much for the response, but this is not quite what I mean.  I do want the user to be able to create new records within the portal, but I do not want the "empty" record to create itself once the user has committed the most recently created record in the portal (this is the default behavior).   What I would like to do -if it is possible- is only have a new empty record create itself when the user wants it, by triggering a "create new portal row" script with a button.  

            The reason for all this is that in the solution, the user has a very tall, single-row portal in which to view one record at a time.  It is less intuitive for the user to have the record automatically create itself, then have to scroll down to see a new record and start typing in it.  

            Thanks!  Joe

            • 3. Re: Turn off automatic new blank record creation in portal
              bumper

              Ah, sorry I misread.

              A script will do the trick. Make a button on the Parent layout and attach this script to it.

              There are a number of custom functions to accomplish this, but it is easy enough to do in basic FMP. This presumes you already have a Parent/Child (portal) lauyout set up and they are related by the Parent_ID to the ParentID_fk.  The basic steps are:

              1. Create a variable and set it to the primary key of the Parent record.

              Set variable ($id, Value: Parent::ID

              2. Go to the related layout of the Child table (portal)

              Go to Layout ["Child", (Child)]

              3. Create a new record.

              New Record/Request

              4. Set the Parent foreign key with a Set Field of the Variable.

              Set Field [Child::ParentID_fk; $id]

              5. Return to the original Parent layout so the user can enter data in the new portal row.

              Go to Layout [original layout]

              This is just the basic skeleton script, but it gets the job done.

              • 4. Re: Turn off automatic new blank record creation in portal
                JB

                Thanks, Bumper, that's a great idea, and this helps me a great deal.  I think I will add "freeze" to the top of the script so the user doesn't see all the going back and forth.