Problems with Subforms

Problems with Subforms

Until now I have not had a need to investigate subforms. But a need arose to create a time-input manager at work and since many people work on multiple projects, a subform seemed to be the base scenario. 

But subforms are really buggy!

First off, it took a while to find how to update a running total of hours as people used the subform to enter projects. Yoge has a demo in the marketplace showing this. 

To calculate a running total, you treat the subform as a collection (for each row in SUB_FORM) as show below for "On Add Row". When you add a new row to the subform, the code tabulates a total number of hours (TOTAL_WORK_HOURS) based on existing rows in the collection.


  
And here's the first problem: If you click to edit that code - it defaults to the wrong collection! It should be set to input.SUB_FORM (collection).



OK, so if you now select input.SUB_FORM (collection), you get this strange window: Note the "optional criteria". How do you input "optional criteria"? I needed that to avoid the ifnull business in the code above.



These issues aside, the code does work to keep a running total. Upon clicking "Add +" the TOTAL_WORK_HOURS was updated.



But now, let's say you want to edit your hours before submitting them. It should be the same code as show above, but for the "On Delete Row".




Nope, it does not work at all. In fact, anything you put in "On Delete Row" seems to be ignored. In this example, I deleted the row I added above. Note that TOTAL_WORK_HOURS is unchanged. It should be ZERO.





Subforms need attention.

The app is shared with support https://creator.zoho.com/sigroup/snap-time

Thanks,

John M. Whitney