This code is compatible with 5.x to 7.x (not optimized for new methodologies in 7.x - but will still run).
INSTRUCTIONS:
1) Make a new form in your solution with no datasource;
2) Make a TEXT form variable called "fv_tables";
3) Put the form variable on your form and make the displayType a TEXT_AREA;
4) Make a button on the form and create a new script called "getTables";
5) Put the code below into the "getTables" function;
6) Launch a client (Smart or Web), navigate to your form and press the button.
Here's the button code:
- Code: Select all
function getTables(event) {
var curFormName = controller.getName();
var formNames = forms.allnames.sort();
var tableNames = [];
var curForm, i, frm;
for(i=0; i< formNames.length; i++) {
curForm = formNames[i];
frm = solutionModel.getForm(curForm);
if(tableNames.indexOf(frm.dataSource) == -1) {
tableNames.push(frm.dataSource)
}
}
fv_tables = tableNames.sort().join("\n");
}
Hope this helps someone out!
Cheers,
Bob