I have a mental block, can't fathom this one out ......wondering which is the best and most efficient way of maintaining a running total on a range of like objects. Each object in a given sequence e.g. Date or Timestamp sequence, adds to the previous object in the sequence and updates its own Balance attribute
So imagine an Order with OrderLineItems. As each line time is added the OrderLineItem.Balance attribute gets updated with the sum of all the previous objects in the sequence. The last item in the grid will end with the Order.OrderLineItem.Balance equalling the sum of all the items. If anyone of the items is edited, and its value changes , all items in the sequence have to then recalculate.
Also if the there are thousands of records, an object rule that updates this balance is going to have to recalculate all the objects resulting in all the rules of the object firing every time an edit takes place. So if any item is edited all items have to recalculate - thinking of overhead here. In a simple Order with OrderLines it won’t matter.
Any ideas on how to achieve this in the most efficient way will be most appreciated
here is an example pic
