I don’t think there’s a straight forward way to do this. Looping recursively through all the tabs from the currencontroller form doesn’t work if your form can be on multiple tabs, as you said.
So I think the only option is to “keep track” yourself while your user is navigating through your application. For example: Have a global onShow-method add the formname to a global array for all (levels of) forms.
As a form can only be visible once, you could loop through the entire tree of visible forms.
For now that is the only option.
In the next major version of Servoy, we’ll introduce a function on the form object to get it’s parent. This will off course only work for visible forms.
1- Start at the currentcontroller
2- Loop through the elements on the form to find all tabpanels, or use the solutionModel (>=4.1) to get all the tabpanels
3- for each tabpanel:
4- get the form in the active tab and do step 2 again