1 2 3 Previous Next 36 Replies Latest reply on Oct 9, 2016 5:48 AM by ericjungemann

    v15.0.2 Go to Portal Row BUG

    maximums

      Hello all

       

      Yesterday I reported a new bug, new to v15.0.2 that is, to FMI. It has been confirmed a bug with no known fix. So, my advice if you use this methodology in your scripting is to NOT update to v15.0.2 until there is a fix, or rework your methodology:

       

      The script step is:   Go to Portal Row [ Next , exit after last ] (when nested in a loop)

       

      Thus the user is trapped in the looping script with no escape potentially creating zillions of records...eeek

       

      Cheers

      Linda

        • 1. Re: v15.0.2 Go to Portal Row BUG
          BruceRobertson

          User scripting error.

          Not a bug.

           

          According to tests done by Darren Terry and noted on FMPExperts:

           

          Hi Linda: I cannot reproduce this. I’m running FMPA 15.0v2 on Mac OS X 10.11.6. FMPA 15.0v2 behaves precisely as all previous versions of FMP did. That is, if the relationship from parent to child DOES NOT allow creation of related records, then any looping script that uses Go To Portal Row [ Next ; Exit after last ] works as expected.

           

          If, however, the relationship DOES allow creation of related records, and you are setting a field in the portal while looping (say, updating the related child records in a loop), then you will be creating related records once the loop gets to the “last” portal row, which is the empty row that allows creation of related records. This is exactly as all previous versions of FM have always worked.

           

          I cannot get a test script to fail. There must be additional info that I’m missing.

          • 2. Re: v15.0.2 Go to Portal Row BUG
            maximums

            To the best of my knowledge it is a bug. I have reported it to FMI and I have had feedback that it is the case. My setup has been tested on both Mac OSX 10.11.6, FMPA 15.0v2, Mac OSX 10.11.6, FMPA 15.v1, Terminal Services, Windows, FMP 15.0v2 and Terminal Services Windows, FMP15.0v1. Off hand, I don't know what version of Windows my client is running.

             

            FMP15.0v1 on both platforms behaves as expected, ie. it exits the loop at the last portal row using a relationship that enables creation of portal records.

             

            FMP15.0v2 does not exit.

             

            The relationship:  People to Colour, matching fields People ID, allow creation of Colour records

             

            The layout:  based on people TOC with a portal using the People to Colour TOC

             

            The script steps:

             

            On save from orgName field on People:

             

                 Go to Portal Row [ Select ; First ]

                 Loop

                      Set Field [ people.Colour::OrgName ; people.OrgName ]

                      Go to Portal Row [ Select ; Next ; Exit after last ]

                 End Loop

             

            This scripting has worked as expected for the last 4 years in this particular file, so through a number of FileMaker versions, but stopped as soon FM15.0v2 was installed on my client's setup. I then tested it on my Mac using FM15.0v1 and all was good. I updated my Mac to FM15.0v2 and it failed to exit the loop, continuing to go to the next portal row and create a new record, etc. Rolling back the client's install resolved the issue. Creating a brand new sample file, as above, recreated the problem in FM15.0v2 but ran as expected in FM15.0v1. Rolling back my Mac also resolved the issue and the script ran as expected.

             

            The portal is on the layout. The above example is my test file, not the client code, however the client code is identical with the exception of the table, TOC and field names.

             

            Is my methodology flawed? If so, I'd appreciate feedback on what, how and why?

            • 3. Re: v15.0.2 Go to Portal Row BUG
              scottworld

              No, this is not a bug. When you allow people to create new related records DIRECTLY from within the portal, there is no such thing as a "last" portal row... because you can keep creating new portal rows so there is never a last row. You need to script this in a different way to make it work. Why not just go to the related records and replace the contents there instead of looping? That's faster than looping anyways.

              • 4. Re: v15.0.2 Go to Portal Row BUG
                BruceRobertson

                This is not a bug.

                It delivers the same behavior in all versions. Since forever.

                I just created a simple test file and tested in FM15, 14, 13, 12.

                 

                What is the purpose of this script?

                How many records do you WANT to create?

                 

                GO to the row; OK. But why SELECT the portal row?

                I'm not a fan of walking portals anyway.

                • 5. Re: v15.0.2 Go to Portal Row BUG
                  maximums

                  I still think this is a bug. It is new behaviour. This scripting works as I expect it to in previous versions and the first release of v15.

                   

                  Whilst I appreciate what you are saying with regard GTRR then looping through each record, speed is not an issue in this instance. There are never more than 20 child records to deal with and to GTRR will cause screen flash in Windows which is the environment this client is using.

                   

                  I'll step through it again to explain my logic in italics prior to the step performing and why I think it should work.

                   

                  * Go to the first portal row to give the rest of the script context. There will always be a minimum of 1 child record and maximum of 20

                      Go to Portal Row [ Select ; First ]

                   

                  * enter the loop from the now active first row

                       Loop

                   

                  * set the named field with the edited data from the parent record

                            Set Field [ people.Colour::OrgName ; people.OrgName ]

                   

                  * go to the next portal row. If there isn't one, thus the focus is now after the last, exit the loop. There a next portal row because the next record hasn't yet been created. In a visual/layout sense, there isn't a next row, there is only display of an empty row in preparation of entering data that would establish a new child record using the fields defined in the TOC

                            Go to Portal Row [ Select ; Next ; Exit after last ]

                   

                  * self explanatory based on the previous step

                       End Loop

                   

                  New portal rows would only be created if the "Go to Portal Row [ Select ; Next ; Exit after last ]" was positioned before the "Set Field [ people.Colour::OrgName ; people.OrgName ]" step.

                  The order of these steps would cause FM to set the field on a blank row and then the next loop would go to next.

                   

                  I trust my Australian English isn't too confusing.

                  Cheers

                   

                   

                  Linda

                   

                  • 6. Re: v15.0.2 Go to Portal Row BUG
                    philmodjunk

                    Sorry, but unless you have omitted some key detail here, this is not a new behavior.

                     

                    I first trapped myself in a loop like this back in Filemaker 10--the first version that used portals.

                     

                    The last portal row in a portal where the relationship allows for creation of new records is not a row with an actual record. It's  blank "add row" where setting a field does two things:

                    1) It creates a new record

                    2) This in turn causes a new "add row" to appear and you are no longer on the last row

                     

                    The script will never get to "after last" as it will chase it's shadow indefinitely. The "last portal row" will always be one row further down as long as each iteration of the loop creates a new related record via the set field step.

                    • 7. Re: v15.0.2 Go to Portal Row BUG
                      maximums

                      Would you like a copy of the test file Bruce? It is interesting we have experienced the opposite behaviour for so many versions.

                       

                      This example is not to create child records but to edit existing child records.

                       

                      As for the number of records, it isn't relevant except for speed considerations.

                       

                      The SELECT is the default settings. I see no reason to change it.

                       

                      What are "walking portals"? I've not heard that expression before.

                      • 8. Re: v15.0.2 Go to Portal Row BUG
                        philmodjunk

                        The script will edit existing records until it gets to the last portal row, then set field will create a new one.

                         

                        So unless your script does not attempt to set or insert data on the last portal row, this is expected behavior.

                         

                        Try running the script in the debugger and watch what happens as the script reaches the last rows of the portal.

                        • 9. Re: v15.0.2 Go to Portal Row BUG
                          BruceRobertson

                          NOT a bug.

                          NOT new behavior.

                          However, are you leaving out details? Are there other portals on the layout?

                          On or off the visible area?

                          Example attached.

                          • 10. Re: v15.0.2 Go to Portal Row BUG
                            BruceRobertson

                            Yes, it would definitely be interesting to see a copy of your file.

                            • 11. Re: v15.0.2 Go to Portal Row BUG
                              scottworld

                              Sorry, this is NOT new behavior. This behavior goes back 23 years, when portals were first introduced in FileMaker. Change your script if you want to change the behavior.

                              • 12. Re: v15.0.2 Go to Portal Row BUG
                                scottworld

                                If anything changed, it's something that you personally changed on your end. What you PROBABLY did was check the checkbox on the relationship graph that allows you to create new records through the relationship. That gives you a blank portal row at the bottom of the portal, which lets you create an unlimited number of rows. Uncheck that checkbox to restrict your portal to just the current number of rows.

                                • 13. Re: v15.0.2 Go to Portal Row BUG
                                  BruceRobertson
                                  The relationship:  People to Colour, matching fields People ID, allow creation of Colour records
                                  This example is not to create child records but to edit existing child records.

                                  Contradictory statements.

                                  • 14. Re: v15.0.2 Go to Portal Row BUG
                                    David Moyer

                                    Hi,

                                    is it possible this is a 32/64-bit issue?

                                    1 2 3 Previous Next