Search code examples
tabstabcontrolfilemaker

Is there a way to return to the same tab panel after navigating to another layout?


I'm using Filemaker Pro 19. On one layout, I have a tab control with multiple panels. On each panel, there are buttons with scripts to navigate to another layout and perform a specific search (e.g. press the button for 'apples' and it will direct you to a layout showing you the results for searching for 'apples' records). This tab control helps us spatially orient in the data (think of a map, click on "USA" on the map and it directs you to a layout with all the records about "USA"). Once you're on the second layout sometimes you want to return to the "map" layout, so there's a button to navigate back to that layout (e.g. you realize you didn't want to click on "USA", you wanted to click on "Canada"). Each panel of the tab control has a different set of buttons (e.g. one panel for North America, one for Europe, etc).

My question is: is it possible to have a button to navigate back to the "map" layout and return to the same panel you were on previously?

Currently, it navigates back to the layout and shows the first panel of the tab control but that can get tedious if you want to scan through multiple records quickly using the map. I haven't been able to find anything online about using scripts to navigate tab panels. I'm still new to FM so I appreciate any creative suggestions!!


Solution

  • You can go to a specific tab panel using the Go to Object script step

    Go to Object [Object Name: "Invoice Payment Tab"]

    https://help.claris.com/en/pro-help/content/go-to-object.html

    Note this requires you to name an object in the inspector. Go to layout mode and select that tab panel or an object within that tab panel and name it, e.g.

    enter image description here

    In your case I would set a $$variable or a global field to the tab name that you were on, then the script that navigates back to that layout can have the Go to Object script step to take the user to the correct tab.