OnPanelSwitch
Triggers a script to run when a panel control changes panels. This can happen, for example, when the focus in a panel control moves to a different panel or when a user clicks an inactive panel in a panel control.
When the script runs
Before the event has been processed.
Modes in which the trigger can be used
Browse and Find modes.
Result
You can use the Exit Script script step within the triggered script to return True or False.
 •
 •
Originated in 
FileMaker Pro 12.0
Notes
OnPanelSwitch applies to the entire panel control and not to individual panels. To control switching to particular panels, use the Get(TriggerCurrentPanel) and Get(TriggerTargetPanel) functions.
Related topics 
Setting up script triggers
Setting script triggers for layouts
Setting script triggers for objects