9 Replies Latest reply on Aug 24, 2011 7:28 PM by RedL

    Goto layout name by calculation

    RedL

      Title

      Goto layout name by calculation

      Post

      I list useful layout names for users to select and open it.  Layout will be displayed by "Goto Layout [$Layoutname]" which is done by "layout name by calculation". It works for most of layout, except few layouts.  For example, I have one layout, name by "customer".  It cannot be shown.  I search all layouts and there is one "customer" layout only.  It works, if I rename the layout to "customer1".  Why it cannot be named by "customer" and open by "Goto Layout [$Layoutname]"?

        • 1. Re: Goto layout name by calculation
          philmodjunk

          Only thing I can think of is that you have an extra and invisible character in your layout name such as a leading or trailing space character.

          Make sure that the layout name is really "customer" and not " customer" or "customer ".

          • 2. Re: Goto layout name by calculation
            RedL

            Yes, that was the first thought when I encountered this issue.  I am 100% sure there does not have any hidden characters before or after on my layout name and my list. I used debug and check the $layout variable carefully.  It is "customer".

            • 3. Re: Goto layout name by calculation
              philmodjunk

              I'm suggesting that the layout name may have an extra character rather than the text stored in your $Layout variable.

              As test, I'd perform this script on the customer layout and see what I get:

              Show Custom Dialog [Quote ( Get ( LayoutName ) ) ]

              You should see: "customer" in the custom dialog. If you see a space between the quotes and the name or a quotation mark starts on a new line, then you know that this is not the case.

              If your are running the script debugger to check your script, then that would rule out another possibility, which is an OnLayoutEnter or OnRecordLoad script trigger on that layout that might perform after this script takes you to the layout and in doing so, take you to a different layout.

              • 4. Re: Goto layout name by calculation
                DavidJondreau

                What actually happens when you use Go to Layout($$LayoutName) and $$layoutName is declared as "customer"? Does FileMaker return an error? Does it go to a different layout?

                What happens when you use Go to Layout("customer") and hardcode the name rather than use a variable?

                • 5. Re: Goto layout name by calculation
                  RedL

                  1. the layout name is "Customer" from Show Custom Dialog [Quote ( Get ( LayoutName ) ) ]

                  2. No error code and nothing happen.  It stays at same layout.

                  3. Hardcode Go to layout("customer") is same.  No error code and nothing happen.

                  I have 30+ layout and 9 of it cannot use Go to layout("layoutname") to show up layout.

                  • 6. Re: Goto layout name by calculation
                    DavidJondreau

                    As Phil says, check for script triggers on the customer layout and the layout you're leaving.

                    What happens when you try to navigate using the Layout menu? The Go to Layout menu item? A Go to Layout... script step (not "by name"?

                    DJ

                    • 7. Re: Goto layout name by calculation
                      philmodjunk

                      If all else fails try recovering the file and test the recovered file (even if the recover process reports not finding any problems) to see if the problem persists in the recovered copy.

                      Things to keep in mind about Recover:

                      Recover does not detect all problems

                      Recover doesn't always fix all problems correctly

                      Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.

                      • 8. Re: Goto layout name by calculation
                        kraaijeveld

                        This is the cause: you have a layout folder with the name 'customer'. Change that and it works.

                        • 9. Re: Goto layout name by calculation
                          RedL

                          Thank you.  It works, finally.