Get all forms on a form

How can I get all forms that are embedded on a form?

Hi Sebastian,

you can achieve this by getting all the elements on the particular form.
then loop through them and for the element of type ‘tabpanel’ you can request the number of tabs on it, loop over the tabs and get the form names.
restriction: all the tabpanel elements must have a name in order to get them returned.

var _aElements = elements.allnames;
for (var i = 0; i < _aElements.length; i++) {
	if(elements[_aElements[i]].getElementType() == 'TABPANEL') {
		/** @type {RuntimeTabPanel} */
		var _tp = elements[_aElements[i]];
		var _nTabs = _tp.getMaxTabIndex();
		for (var t = 1; t <= _nTabs; t++) {
			application.output(_tp.getTabFormNameAt(t));
		}
	}
}

If you don’t set any tabs at runtime, you can also use the solutionModel to get them, basically the same as above.
restriction: this will not reflect any runtime changes

var _jsForm = solutionModel.getForm('myForm');
var _jsTabpanels = _jsForm.getTabPanels();
for (var i = 0; i < _jsTabpanels.length; i++) {
	var _jsTabs = _jsTabpanels[i].getTabs();
	for (var t = 0; t < _jsTabs.length; t++) {
		var _jsTabForm = _jsTabs[t].containsForm;
		application.output(_jsTabForm.name);
	}
	
}

Hope this helps