2 Replies Latest reply on Mar 18, 2013 4:10 PM by raybaudi

    Portal Data Entry (Default Top Row)

    jameshoty

      Title

      Portal Data Entry (Default Top Row)

      Post

           Dear FileMaker,

           Is it possible to have the data entry in a portal setup environment to be defaulted at the top row instead of the last row? This is so that the user can speed up the data entry instead of always scroll down to the last row. 

           Regards,

           James

           FileMaker since Oct'2012

        • 1. Re: Portal Data Entry (Default Top Row)
          philmodjunk

               You cannot set up a portal to have the add row appear at the top, but you can use a set of (usually global) fields postioned at the top of your script with a script that uses the data to create a new record in the portal's table that contains the data entered into this set of fields.

               Let's pretend that your portal is based on this relationship:

               Main::__pkMainID = Portal::_fkMainID

               and that there is only on other field in Portal, Name.

               Add a field to your database named gName and give it global storage. Global fields can be accessed from any script and from any layout in your file so you can define it in Main or in its own special table of global fields. We'll put it in Main just to keep things simple.

               Position Main::gName at the top of the portal and put a button next to it for adding data from gName to a new record in Portal.

               It can perform this script:

               Freeze Window
               Set Variable [$$TriggersOff ; value: True ]
               Set Variable [$PK ; Main::__pkMainID ]
               Go to Layout ["Portal" (Portal)]
               new Record/Request
               Set Field [Portal::_fkMainId ; $PK ]
               Set Field [Portal::Name ; Main::gName ]
               Go to Layout [Original Layou]
               Set Variable [$$TriggersOff ; value: False ]

               Notes:

               Scripts that change layouts can trip a number of script triggers. The scripts performed by such script triggers can slow execution and can interfere with the correct execution of your script. To keep them from interfering, you can write any trigger controlled script like this:

               If [ Not $$TriggersOff ]

                  #Put rest of script steps here

               End If

               This allows you to use the global variable $$TriggersOff as a switch to disable trigger controlled scripts, but only if you write the scripts so that they check the value of this variable.

          • 2. Re: Portal Data Entry (Default Top Row)
            raybaudi

                 "Is it possible to have the data entry in a portal setup environment to be defaulted at the top row instead of the last row?"

            Hi

            also look at https://fmdev.filemaker.com/thread/69725