13 Replies Latest reply on Feb 8, 2013 12:23 PM by rdhughes

    FM Go flashes wrong layout

    rdhughes

      Good morning,

       

      I'm brand new to the FileMaker Developer Community -- I'm self-taught, from FM7 and now running FM12 and Go; the latter for the first time.

       

      Firstly, I hope I'm posting this issue in the correct place! Secondly, I have had a look around the forums to try an find an answer to my query, but can't seem to find anything specific that helps. I'm sure this will be a quick fix for a non-newbie like myself!

       

      • I'm creating a new CRM for my company, which I will be making available on FM12 (on Macs) and FM Go on iPhone and iPad.
      • I have created a test database, just to have a play around -- and the first thing I wanted to try was a "device aware" Opening Script, to select a specific layout based on the device being used.
      • I followed this helpful tutoral to the letter, and everything worked fine... With one, annoying issue...
      • When I open the test database in FM Go, it flashes up (instantly and very quickly) the "Desktop" layout first before going to the correct Go layout!

       

      Is there anything that can be done about this? I know it's only a minor issue, but it is very annoying!

       

      Many thanks, in advance of your support.

       

      David

       

      David Hughes

      R&S Hughes Limited

      web@bobhughes.co.uk

        • 1. Re: FM Go flashes wrong layout
          PSI

          David,

           

          The last layout the was on file when it was closed before it was hosted is the first layout that will be displayed. This actually happens on the desktop it just happens faster so you might not notice it. just unhost it, open in in FMP go to the layout you want it to open on and close the file.

           

          John Morina

          PSI

          CCQ-FM, Inc

          • 2. Re: FM Go flashes wrong layout
            rdhughes

            Hi John,

             

            Thank you for your response. I certainly follow your thinking.

             

            However, my solution will be hosted (via RapidHosts) and accessed by six iPhones/iPads plus at least three Macs, ad hoc. In other words, there's no predicting which device will next open the database... Is there, perhaps, a script step that would allow the system to do the device check *before* opening a window (as a perminent fix)?

             

            Thank you again, John.

             

            David

            • 3. Re: FM Go flashes wrong layout
              PSI

              Sorry for not being clear...Before hosting make sure when the file is closed on the opening layout. Once hosted it will not change.

               

              I think this happens because the opening script will run 'on first window open' opening to the last layout it was closed on when not hosted before the script can navigate to the layout you want.

               

              John

              • 4. Re: FM Go flashes wrong layout
                rdhughes

                I think it might be me who's not being clear. Apologies.

                 

                The opening layout will need to be different, depending on the device being used to access the database. For example:

                 

                • I'm in the office, working on the Mac, and I open my hosted database using FM12 -- my opening script tells it to open on "DesktopLayout"
                • I then go to a client's office, open the same hosted database using FM Go -- my opening script tells it to open on "iPadLayout"

                 

                As I said previously, this functions perfectly well. But in the scenario above, when I open the database using FM Go, it flashed up "DesktopLayout" before going to "iPadLayout". It's this "flashing", I'm trying to eliminate...

                 

                I hope this clarifies things a little? And again, thanks for your help.

                 

                David

                • 5. Re: FM Go flashes wrong layout
                  PSI

                  Ah, what i do is create an opening splash layout. So it always opens to that layout then the script takes over and navigiates from there...

                   

                  I usually put on the layout

                   

                  Opening System My Database System....

                   

                  One Moment Please....

                   

                  The OnOpen script will resize the layout and pause for a second or 2 them move on...

                   

                  John

                  1 of 1 people found this helpful
                  • 6. Re: FM Go flashes wrong layout
                    rdhughes

                    John,

                     

                    Thanks for this -- very helpful. I will implement this in my final database.

                     

                    Am I to assume then, that there's no "fix" for this issue within the script itself?

                     

                    David

                    • 7. Re: FM Go flashes wrong layout
                      BruceRobertson

                      Impossible to say. We have not seen your script.

                      • 8. Re: FM Go flashes wrong layout
                        PSI

                        This really isn't broken so the 'fix' is to understand the behavior. Apparently the database needs to open to a layout and does so before firing off the script.

                        It's not generally seen on internal networks because it happens very fast. This 'flash' of a layout has been present since at least FM 10.

                         

                        John

                        • 9. Re: FM Go flashes wrong layout
                          rdhughes

                          Understood, John, and thank you for your help with this.

                           

                          I'll implement your suggestion of a splash layout.

                           

                          David

                          • 10. Re: FM Go flashes wrong layout
                            rdhughes

                            Actually, Bruce, if you look at my original post I said that I followed this helpful tutoral to the letter. This is the script:

                             

                            If [PatternCount ( Get ( ApplicationVersion ) ; “Go_iPad” ) = 1]

                                        Go to Layout [“iPad_Home” (HOME)]

                            Else If [PatternCount ( Get ( ApplicationVersion ) ; “Go” ) = 1]

                                        Go to Layout [“iPhone_Home” (HOME)]

                            Else

                                        Go to Layout [“Home” (HOME)]

                            End If

                             

                            Do you have any suggestions that might help?

                            • 11. Re: FM Go flashes wrong layout
                              DavidJondreau

                              Under File Options... there is a choice to set an opening layout. Choose your Splash layout there.

                              • 12. Re: FM Go flashes wrong layout
                                ch0c0halic

                                When a client opens a hosted file it receives the 'default' layout before anything else. FMP must open the file to a layout, must then download the layout list/scripts/custom functions/DB schema, etc., and then determine which layout to switch to and which script to run on first window open.

                                 

                                Without all that information the FMP client has no context as to where you are or what to do.

                                 

                                I suggest during development you add a closing script that always goes to your "Opener" layout, edits something so the change is recorded, and then close the file.

                                 

                                Just changing layouts before closing does NOT guarantee it has become the default layout. Changing layouts is not something that triggers saving file to disk. You must do something to the file that requires a save to disk operation. I think the Flush Cache script step may work for you in this case.

                                 

                                 

                                The opinions expressed in this email are my own and do not reflect those of my employer or anyone else.

                                Regards,

                                Ch0c0halic, FileMaker 12 Certified Developer

                                1 of 1 people found this helpful
                                • 13. Re: FM Go flashes wrong layout
                                  rdhughes

                                  Many thanks, Ch0c0halic, for a really useful and informative response.

                                   

                                  David