OK....this is likely very simple, but I'm struggling.
I have a Registration object that includes an attribute named, TotalPaid. It's numeric and specified to be calculated. It also has a MyPayments attribute of the type Payment (child of Registration).
I have a Payment object that has an AmountPaid numeric attribute. There can be multiple Payment instances for a specific Registration.
I'd like to be able to sum up all of the Payment.AmountPaid for any particular Registration and have that number appear in Registration.TotalPaid.
Thought I had it working, but it seems to be summing ALL Payment instances, not just the ones associated with a specific Registration.
Thought I could do the following as a rule in Registration:
IF EXISTS Payment WHERE (Payment IN ThisRegistration.MyPayments)
Then TotalPaid = SUM (ThisRegistration.MyPayments.TotalPaid)
Else TotalPaid = 0
Obviously, I'm getting all Payment instances into Context.