Thanks Mark. I saw that setting, and don’t know how it got turned off. I fixed that and a couple other things that were wrong. Now this works properly. If you don’t mind, I’d like to ask a few questions to help me make the application more streamlined. Here is my GenerateReports form:
When I click one of the study group names the IsSelected properly flips and updates the form. When I click action buttons for All Groups and No Groups, all X’s and checkmarks properly get set.
Question 1:
Right now, I have 4 client-side functions that get called when I click the various action buttons. Is there any way I can, inside the function called by the click event, identify just which button was clicked? Knowing this would allow me to do everything in a single client-side function. In c#, I’m used to having a “sender” property that returns the object that generated the event.
Question 2:
Ditto for clicking one of the study groups in the subform. You don’t see on the screenshot, but below the study groups there is another similar subform for the Portfolios attached to that report. If I click a StudyGroup Name, I believe I do have access to the underlying StudyGroupKey in the fields collection. Clicking a Portfolio in the other subform should also give me access to the PortfolioKey for the record I clicked. Could I check for the undefined state of each of those keys to identify where I clicked? This would let me economize on how many functions I need to code. Or is there a better way?
Question 3:
Here is a snippet of a typical client-side function. This was suggested by you folks:
const _five = five;
five.executeFunction('InitSubformServer', myParms, null, '', '', function (result) {
if (result.serverResponse.errorCode === 'ErrErrorOk') {
five.refreshTable(joinTable);
five.reload();
return;
}
let functionMessage = result.serverResponse.results;
if (functionMessage !== '') {
_five.showMessage(functionMessage);
}
});
return five.success(result);
This is working fine, but I’m curious: why in the first IF block does the code return, and without the five.success(result) that’s on the bottom. Wouldn’t it be better to not return, and put the balance of the function in an else{} block (except for the final return)? If the first IF is true, doesn’t that guarantee that the second IF will be false? And why is there a statement that sets _five to the five object?
Thanks so much for your help so far!