1 of 1 people found this helpful
I don't see how you determine which tab panel you are on. With out that, it is probably running the wrong sort script.
In 11 You can use an onobject modify script trigger on the tab to start the script and get(fronttabobject???) to determine which tab. You will have to check the get function, I can't recall the exact function name and Im away from the computer at the moment.
Get( TriggerCurrentTabPanel ) returns the name of the tab the user was viewing when they clicked the name of a different tab. (i.e. the old one)
Get( TriggerTargetTabPanel ) returns the name of the tab the user clicked on. (i.e. the new one)
And remember that both of these return a two-value list, with the first value being the tab number, and the second value being the tab name.
Check the online help for more details.
Solved using the following:
GetValue(GetTargetTabPanel);1) = 3
The 1 equals the first value and if that "3" equals the Third Table panel, then sorts on the desired sort value. I guess I could also have tested for the "Name" of the Tab Panel to do the same thing but this is working as desired.
Thanks Morgan & Bruce, I had overlooked the GetValue part when I looked at the online help.
You are missing about quite a few things; and this has also revealed a FileMaker 12 bug.
1. As mentioned by Morgan, you are calling the wrong function.
Get( TriggerTargetTabPanel ) returns a list of the TARGET tab panel index and (if it has one) the layout object Name of the target tab panel
2. The name of a tab panel and the layout Object Name of a tab panel are completely different properties.
I suspect you may not have named your tab panels. The text the user sees on the tab is not the layoutObjectName of the tab.
So for instance a result might look like this IF you have named the tab panel correctly:
3. Since the result of Get( TriggerTargetTabPanel ) is a list, if you are going to compare it to a literal text value such as "Alert" you need to get the second value from the list.
getValue( Get( TriggerTargetTabPanel ); 2)
Normally when working with a FileMaker list, you can manipulate it; such as performing a substitution like this:
Substitute( someList; ¶; ", ")
The above expression changes all returns in a list for comma space.
HOWEVER, the result of Get( TriggerTargetTabPanel ) is not a standard FileMaker list.
For some reason the delimiter is the enter character, char(10), not the return character, char(13).
So the above substitution doesn't work.
The bug is noted here:
The script step from my previous reply had a typo, correit was GetValue(Get ( TriggerTargetTabPanel );2) = "Alert"
It also works usingGetValue(Get ( TriggerTargetTabPanel );1) = 3
But it makes more sense to use the tab panel name which I originally had entered into the Name in the Inspector. Using the tab panel name avoids the issue of having tomodify the script when an additional panel is created.