6 Replies Latest reply on Dec 5, 2011 8:54 AM by ZoocMan85

    Go to a certain place in a layout

    ZoocMan85

      Title

      Go to a certain place in a layout

      Post

       Hey Everyone,

       

         Im trying to write a script to go to another layout and then go to a certain section on that layout. So for ex. Im on layout#3..Layout#3 has its own table...I want to go to Layout#2 but layout number 2 uses the same table as layout#1. If i do a script and say ...Go to layout number 2 and then go to field notes which is displayed only on layout#2...it will just take me to the top of layout#2. Im thinking this is happening cause the table name for layout#2 is based off of layout#1 so it doesnt know where to find the field. What can i do  ?

        • 1. Re: Go to a certain place in a layout
          philmodjunk

          Go to field uses in internal ID number assigned to that field instead of the field's name. Thus, similar names are not an issue. However, if the field is not actually present on the current layout it will silently fail to put the cursor anywhhere and you will likely find the cursor appearing in the field that is listed first in that layout's tab order. (You can change the tab order of layout objects, by selecting "set tab order" from the layouts menu whil in layout mode.) This is just one possible explanation.

          Another option is that a layout based script trigger like OnLayoutEnter or OnRecordLoad is being tripped by your script when you change layouts and this script could be putting the cursor in a different location. Using "Layout #1" type references actually makes this harder to analyze, not easier.

          Two suggestions:

          1. If You have FileMaker advanced, enable the script debugger and then perform your script and watch it execute step by step.
          2. Post your script here for us to see so that we can comment on any issues we see in it.

          To post a script to the forum:

          1. You can upload a screen shot of your script
          2. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
          3. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
          4. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional look to your script. (Use the HTML option and paste the text into the HTML editor.)
          • 2. Re: Go to a certain place in a layout
            ZoocMan85

             My script is very easy...

             

            Go to layout Calc2

            Go to field Notes

            End Script Notes

             

            The sciprt will take me to the layout but the notes field is on page 2 of that layout. It just goes to the top of the layout.

            • 3. Re: Go to a certain place in a layout
              ZoocMan85

               I ran the script debugger... No errors.

              • 4. Re: Go to a certain place in a layout
                ZoocMan85

                 I even tried going to an object on that layout that was a text field to use as like an anchor. All i need is when it goes to that layout is to go to page 2.

                • 5. Re: Go to a certain place in a layout
                  ZoocMan85

                   There is no scripts either on entering or exiting the layout.

                  • 6. Re: Go to a certain place in a layout
                    ZoocMan85

                     Phil.. I figured it out. This is my Scipt

                     

                    Go to Layout Calc 2

                    Scroll Window to End.