Title

Post

Trying to get the active Tab, so you can run code before that tab loads (like a "click" event, which I wished we had), using this technique as recommended by David Jondreau, did not work for me:

GetLayoutObjectAttribute ( "Renewals" ; "IsFrontTabPanel" ).

Although I created a Name = "Renewals" in the inspector and added the script to the onPanelSwitch Event, the script does not fire as the "Renewals" tab loads. Instead, the script runs as I click another tab and at that point FMP realizes, ahh, the "Renewals" tab is front.

However, this behavior doesn't help me at all if I want to prepare a tab before the user sees it.

The first suggestion works from the OnObjectModify trigger while the second works from the OnPanelSwitch trigger (name is different in version 12).

OnObjectModify performs the script AFTER the triggering event (the change in panels) is processed by FileMaker. The OnPanelSwitch trigger performs a script BEFORE the triggering event is processed. You can even use Exit Script [False] to keep the clicked panel from ever becoming the front tab (or slide control) panel if you want.

The first method was our only option in FileMaker 11. The second was added in version 12, renamed and extended to slide controls in Version 13.

Note that all script triggers can be classifed as either "after the event" or "before the event" triggers. All "before" triggers can perform a script that uses Exit Script [False] to keep the triggering event from being processed. See "setting up script triggers" for a table that lists all triggers and identifies which are "before" triggers and which are "after".

Nope, sorry. I thought I had a point, but now that I read my posting again, perhaps I was rambling...

I abandoned the tab since I wanted to display a listing report on another of the tabs, but couldn't adjust the window so it wouldn't also affect the other tabs (by design, I'm sure). The grid view is ugly so I wanted to be able to list the matching records from a find in a nice layout.

The other $%(!!*(&$(%&* thing I did was mistakenly created a date field as a text field. Then spent several hours trying to understand why my date calculations were always off. Jeeez!