HI,
I’m trying to show or hide Action Buttons depending on which form page is active.
Here is a screen shot of my SetupReports screen:
And here is the screenshot of same form with second page selected:
Please note I only captured the screenshot showing the first 4 items in the dataview.
Notice the All and None action buttons on form header. I’ve configured these buttons to only show if I’m viewing the subforms (hope terminology is right. I consider the pages other than General as subforms).
I don’t know the proper way to hide/show the action buttons depending on the active page, so I came up with “my” method. I wrote functions called SetSubformNameStudyGroups, SetSubformNamePortfolios, SetSubformNameMembers and SetsubformNameNone. Here is the code for these:
function SetSubformNameStudyGroups(five, context, result) {
five.setVariable('SubformName', 'StudyGroups');
five.showMessage('SubformName: ' + five.variable.SubformName);
return five.success(result);
}
The only difference between the 3 functions are the value of the variable, either StudyGroups, Portfolios or Members.
The final function, SetSubformNameNone contains this:
function SetSubformNameNone(five, context, result) {
five.clearVariable('SubformName');
five.showMessage('SubformName: ' + five.variable.SubformName);
return five.success(result);
}
The General events page looks like this:
The StudyGroups events page looks like this:
The other pages look like this page, except for the name of the On Selected function. This all seems to work, and the variables are set properly.
So here is the question: Am I doing this properly, or is there a better way to hide/show these action buttons? I can’t find anything anywhere in the inspector that identifies which page is active.
The way I’m doing this seems quite roundabout. Is there something simpler that I don’t know about?
Also, am I mis-understanding the meaning of subform? Can’t seem to find a definition of that in the docs.
Thanks…