September 2, 201312 yr To make my request simple, suppose I have multiple children records for each parent record. In each child record there is a number. I want to add up that number from each of the children records for each parent and put that total in the parents record. I know you can have summaries on a report, but how do you get the total into the parents record? As an example, if each child record contains the amount of a tuition payment for a particular family. There are a number of these payments during the year. I want to total that amount for the year and put that amount into the parent record as total tuition paid by each family for the year. Make sense? Help?
September 2, 201312 yr Every time a child record is created or modified (Script Trigger / OnRecordCommit ) push the total of all the child records with the same parent ID to desired field in the parent record. You can do it with a relationship or ExecuteSQL: ExecuteSQL ( " SELECT sum ( c.amount ) FROM child c WHERE c.id_parent = " ; ", " ; "¶"; id_parent )
September 3, 201312 yr The Sum function will add up all the numbers of related child records. The calc field using the Sum function would be in the parent table.
Create an account or sign in to comment