Did you use the inspector to give the panels the object names you used here in quotes? Are they in quotes when you check the object names via the inspector? (I make that last question, because "Workshops::BudgetSummary" has the the syntax used in FileMaker for accessing the value of a field and that might cause an issue here.
Note that the panel's label and its object name are not the same. A Label is specified in Tab Control Setup and object names are specified in the Inspector.
That said, here are some other comments:
I you are using a recent version of FileMaker, there are two get functions that will return a value when the OnPanelSwitch trigger is tripped. GetTriggerTargetPanel will tell you (in list format), both the object name and the panel number of the tab or slide control panel brought to the front when that script trigger was tripped. This can make for simpler scripts and simpler expressions. Look this one up and use GetValue if you want to just get the number or just the object name.
There are better options for setting a global field or variable to a value than Insert Calculated Result. This script step will not work if the global field is not present on your current layout. Use Set Field instead of Insert Calculated result to get a more consistent result and one that will avoid tripping layout script triggers (because Insert steps put the cursor in the field, this can trip a number of script triggers either currently set up on your layout or something that you might add in the future.)
Awesome info, thanks!
Yes, I named the panels in the inspector. They are not in quotes in the Inspector.
I’ll go through the rest of your post and see if I can get it working.
FYI, my end goal is to have my button bar stay active state remain current with my slide panel when I slide, rather than use the buttons. I’ve seen a number of solutions for this online, but haven’t managed to get any of them to work properly, so I thought I’d just muddle through a solution on my own.
Set Field>Get(TriggerTargetPanel) is the solution for the first step, the global field is now updating properly. Thanks!
They are not in quotes in the Inspector.
But they should be given that you have object names in quotes in your GetLayoutObjectAttribute function calls.
I've played with the "button bar/slide control" setup myself. Much of the time, I decide that it's far simpler just to use a tab control with the tab labels in place of the button bar. The exception to this is when you want certain "tabs" to be invisible to selected users, then the ability to hide a button to make that tab disappear for those users becomes handy.
True, I could just disable swipe, and all would be fine. I do need to hone my scripting skills, though.
Thanks again for the help. Much appreciated.
"I you are using a recent version of FileMaker, there are two get functions that will return a value when the OnPanelSwitch trigger is tripped. GetTriggerTargetPanel will tell you (in list format), both the object name and the panel number of the tab or slide control panel brought to the front when that script trigger was tripped."
Oops. Did it again.
Panel number and object name. In that order.
You'll always get the number. You will get the name, as the second value, if it exists.
There was no error in this post nor the previous similar one were you made the same comment.
I didn't specify the order of the two values returned then and I didn't specify the order now, just indicated that both values are returned in a list. You might note the the follow on sentence tells them to look it up. That's so that they get the technical details straight when they try to implement.
English is not a perfect medium of communication.
We disagree. It is impossible NOT to specify the order. Unlike layout objects, you cannot stack words on top of each other and present them simultaneously.
You mention one; and then the other. It would be better to specify them in the order in which the function provides them.
Yes, it can be of additional value to explicitly discuss the order the getValue method for extracting them.