8 Replies Latest reply on Jul 19, 2013 12:00 AM by schamblee

    portalrow reset



      portalrow reset



           moderately experienced FMP - now dabbling with FMGo

           script has the lines:

           Go to Portal Row [No Dialog; $recnum + 4]
           Go to Portal Row [Select;No Dialog; $recnum]

           which in FMP works fine to jog the portal row so the one you want is in the middle of an nine row Portal - but in FMGo the '+4' step doesn't appear to trigger - Row just goes straight to $recnum...so the row chosen is at the bottom of the portal

           any ideas?

        • 1. Re: portalrow reset

               i'm surprised this script works in pro, because the second Go to Portal is the row it is going to which is whatever number $recnum is at the time.  The +4 is only added for the one line above.  I will give you an example of what your script does.   Also note If you don's set $recnum then it will be 0

               Goto portal Row [....;$recnum+4]  will always go to record 4   because 0+4 is alway 4. Adding 4 to a variable here will make it local only to only this line.
               Goto protal Row [....;$recnum]      will then go to record 0       because $recnum is still 0 

               Script should be something like

               Goto portal Row[Select;Last]
               Set variable[$reccount;value:Get(ActivePortalRowNumber)
               Set variable[$middle;value:$reccount/2]
               Goto portal row [select;no dialog;$middle]


          • 2. Re: portalrow reset

                 sorry, should have made myself clearer...

                 these lines are at the end of a script that sorts a set of records (approx 300) in a table which is displayed in a nine-row portal, then tests each one against a foreign key, then sets the local variable $recnum to the RecordNumber of that record within that set,

                 so going to that $recnum within the portal would default to displaying that record at the bottom of the portal, but to make life slightly easier, I added a step to set the portal row to four records beyond the one I want, then back to the one I want - the portal doesn't re-scroll, and the record I want is now centre of the portal display ... 

            • 3. Re: portalrow reset

                   I did a test on Filemaker Pro 12 with two scripts. One script  goes to portal row 10 then goes to portal row 6, and the second script just goes to portal row 6.  The first script does nothing different than the second script, No matter which script I run I end up on record 6 and it is the first Item in the portal.   I can't duplicate what you descrip happens on Pro.  I get the same results on pro and Go.  

              • 4. Re: portalrow reset

                     screen shot is basic part of script.... $recnum depends entirely on the position of the record in the sorted set

                • 5. Re: portalrow reset

                       After further testing Pro and Go work the same for me, which works sometime.  The go portal row + 4 doesn't always work.  I think a case statement based on the number of records and the record selected, will determine which record to  go to in the first go to portal row will fix the issue.


                  • 6. Re: portalrow reset

                         hi - i tried a suggestion that you posted - which curiously came into my email but isn't visible in the thread here... (?)

                         about going to last row, then back to the one you want - works on FMP (sets record to first row) but not Go...

                         starting to give up :(

                    your post said "I got this working on pro and go.  Instead of go to portal row recnum+4, i used go to portal row first, then goto portal row recnum."

                    • 7. Re: portalrow reset

                           I removed that post because it didn't always work either, after further testing.   Your recnum+4 work most of the time, but not all the time.   I will do more testing when I have time. I ran out of time this morning. 

                      • 8. Re: portalrow reset

                             Take a look at this sample.  With larger number of files, I started having problem with go.  Inserted Refresh Window in between go to portal row and seem to have fixed.