slight amendment to this. performance was slow using the above idea as the portal was being sorted by an unstored calculation. The above method / idea does work but i'd be interested to hear if there are better ones.
Use a sum aggregation function in the parent record to total the related child records. Note - If you need to use the total in a validation test before comitting the portal records, the sum function must total unstored calculation fields.
Have you tried putting the summary field in the child table? FileMaker will filter it by the relationship when you display it on the parent record.
If you're having performance issues with committing or refreshing cache then I think you'll need to take control in your own hands.
I'd start by creating a stored total field in the parent table and manage everything with script triggers.
Notice the script triggers on both checkbox and value field.
Here's a demo file that may help.
PS. I uploaded the file again, there was a little bug with setting the total.
Rushing things is never good..
StoredTotals Demo.fmp12.zip 68.5 K
Thanks very much all
It doesn't update properly unless you click or sometimes hover over the summary field on the layout at the bottom. Like the records are not committed until you click it. I understand this is because portals are what they are - you are sort of "in" another layout (or table) when using them.
Previously I had a modify script trigger on the checkboxes in the portal that acted by going to the layout you are on (the parent one) and commiting records. Works fine when using the database locally but when hosting it and you have lot of records in the portal that trigger means you have to wait quite a long time for it to update when you click the box every time.
By going to the other layout, then back, you were causing a screen refresh, which gave you the updated totals. In your script, after the checkbox for the RSVP is clicked, add a "Refresh Portal" step. That ought to refresh your results and it'll do so much faster because the refresh won't involve as much data going back and forth.
Thanks! refreshing window and object does the trick! Cheers