9 Replies Latest reply on Mar 25, 2014 6:17 PM by alexander1z

    Portal going back to first record and not readjusting

    alexander1z

      I just bought Filemaker 13 today and converted my program which is in Filemaker 11.

      I skipped FMP 12 because of the lasting trauma of converting from 7 to 9. Luckily this conversion is going much better. Or at least it seemed to up until I ran into a portal problem.

       

      I have a portal that contains images and when someone clicks on an image or goes to the next image the portal resets itself and makes the chosen image at the center of the portal (there are 11 rows). OK so after using my program for a while I noticed that the portal was not readjusting correctly, so I went into debug mode and stepped through the script and everything worked fine. (Don’t you love Filemaker). OK I missed something, so I did it again and it worked fine. One more time and everything looked great. Turned off the debugger clicked on go to next record and it didn’t work (i.e. it did not make the selected image the 6th record in the portal). Went back into debug mode and stepped through the script and clicked step into over and over to see if there was some hidden script being called. Nothing.

      There are 300 images in the portal and every time I to go the next record the portal only shows the first 11 images. The portal seems to be set to go back to the first record, but this behavior does not happen when I am debugging.

      It seems FMP 13 portals are different from FMP 11 portals. Could someone please enlighten me on how they are different?

      Would appreciate any suggestions.

       

      Thanks

      Alex

        • 1. Re: Portal going back to first record and not readjusting
          jmrusch

          I've had problems like this a couple of times where something that doesn't work under normal circumstances works just fine in Script Debugger. Try adding a very brief pause step to the script immediately after the script step that most likely takes the longest amount of time. You may need to move the pause step around to figure out where it will solve the problem.

           

          I haven't found anything about this documented anywhere, but it appears that sometimes "slow" script steps essentially time out without an error, and the script moves on to the next step without the prior step having completed. Since everything is slowed down in Script Debugger mode, you never see the problem there. Inserting a pause at a strategic location in the script gives the "slow" script step a chance to fully complete before the script moves on.

           

          Images can be slow to load. When you want to move past the 11 portal rows that are currently showing, it probably takes a while for FM to load up the new images. That should give you a clue where to insert the pause in your script.

           

          Not sure why this is different in FM 13 vs FM 11, but maybe it has to do with differences in how the images are stored in FM 13? I assume you're using container fields for them and there were some changes to container management begininng with FM 12.

           

          Potentially a simple fix, so it's worth a try, anyway!

           

          Julie

          • 2. Re: Portal going back to first record and not readjusting
            BruceHerbach

            Alex, can you post your script so we can take a look?

            • 3. Re: Portal going back to first record and not readjusting
              keywords

              It's also just possible that the issue might be resolved by creating a new version of the portal. I suggest you try that and see if the problem persists.

              • 4. Re: Portal going back to first record and not readjusting
                alexander1z

                Thanks Julie,

                I put in two .1 second pauses and got it to work.  The portal flickers a bit but it works. 

                I am dissapointed that I keep having to create these workarounds to get Filemaker to do what I want it to do. 

                Is it too much to ask that in Version 13 I do not have to slow down a script so that it will work, especially as it worked fine in 11.

                 

                Thanks again Julie

                • 5. Re: Portal going back to first record and not readjusting
                  alexander1z

                  I really do not want to create a new version of this portal as I have 15 or so portals on 5 different layouts very carefully layed out.  I would have to pull the whole thing apart, and reconfigure all the triggered and conditional scripts.  That is a tremondous amount of work.

                  Doesn't the conversion from fm7 to fmp12 automatically update the items (portals, containger fields etc..) to the latest iteration of them?

                  The images look better in Version 13 so I am hoping they act better.

                   

                  Speaking of which can you direct me to a place where I can learn about the new functionality of container fields, and the other added features in 12 and 13.  I would like to avoid buying a 700 page book for the 50 pages that I actually need to read.

                   

                  Thanks again for your help.

                  • 6. Re: Portal going back to first record and not readjusting
                    jmrusch

                    Alex,

                    I'm glad that worked.

                     

                    The "timing out" of script steps is something I first encountered in FM 9 when an "Enter Find Mode" script step wasn't alway executing fast enough, and sometimes the "Set Field" commands that were meant for Find mode were happening in Browse mode -- eek! In that case I added a test for the correct mode, and that slowed things down enough so that solution has never had the same problem since, in 4+ years. Admittedly, that client's network is pretty slow which may have contributed to or caused the problem.

                     

                    The other time I've seen it was a "Go to Layout" script step that didn't always happen fast enough, so the subsequent script commands were happening on the wrong layout. Inserting a brief pause solved that problem. In that case, the layout it was trying to go to was in an external database, which may be why it was slow. That was FM 12.

                     

                    As I said originally, I've never seen this documented anywhere. I added the examples above in case someone in the future has a similar problem.

                     

                    Julie

                    • 7. Re: Portal going back to first record and not readjusting
                      jmrusch

                      There's a technical brief on container fields in FM 12 at https://fmdev.filemaker.com/docs/DOC-2585. Not sure, but you might need to be a paid Tech Net member to get to that.

                      • 8. Re: Portal going back to first record and not readjusting
                        keywords

                        A slight correction. The free TechNet membership will allow access to support documents, this forum, etc. The paid subscription gives additional access to development licences etc.

                         

                        And further to the main discussion, the new thumbnails feature in 12+ will probably speed up your script, alexander1z, as FM can be configured to create a thumbnail only to the size it needs for a given layout without altering the stored image at all.

                         

                        My point about trying a new portal was to test whether this makes any difference. If it does, then it may indicate that the conversion of the portal during file conversion has left some bugginess in place. I appreciate that if this is a problem it could be significant, but it's worth checking for in my view, just in case. More likely, however, the problem could be resolved by updating container storage to take advantage of the new features.

                        • 9. Re: Portal going back to first record and not readjusting
                          alexander1z

                          Thanks Julie,

                          I was able to open it.

                          Looks like scintillating reading.

                          I will have more questions, but it will take me awhile to get through it.

                          Thanks again