And what are those "undesirable results"? (Need to know that before we can suggest an alternative.)
when I add a new record or delete a record all the table::total go blank until I click on the screen!
I would also like to avoid scripting it
I worked it out, if any one knows of a better way or can see where issues with my calculation could arise please let me know
I would go with the summary fields, but script a commit records step to force an update of the summary field every time a new value is added. There's an upper limit to how many records you can have in your found set before you run out of system resources needed to compute a value when you rely on getNthRecord like this. On an iOS device, you can reach this limit very quickly.
But a middle ground that may work is to use the above calculation in an auto-enter calculation to copy values from the preceding record. This creates update issues if you later delete a record, but avoids the limitation that I just mentioned.
I compiled a script which triggers when creating a new record by going fetching the active portal number and setting the value in table::total
The Script goes to the first portal number total::total and loops through to the last checking the fields value against the portal number and changing if necessary.
Same principle for removing records.
Works a treat but maybe that's because I only have a maximum of 10 records in each sorted portal.
Not sure if I will ever need this function for anything with more records than I mentioned but would be interested what you think about using for larger tables