Jump to content

Best way to calculate related field total


Recommended Posts

I have a master table that needs to calculate the total value from many fields in a related, child table. The total must be shown –not necessarily stored– in the master table layout.

I wonder what's the best option:

  1. Create a non-stored calculation field in the master table with Sum (child::value) or
  2. Just display a child table summary field with the total of child::value

Both options seems to work but I would like to know if there's any difference in performance, is option 2 better than 1?

Link to post
Share on other sites

Depends on your situation and how it’s deployed, how many child records, etc.

Simple enough to try both ways and test performance.  

Link to post
Share on other sites

3.  Script any edit or creation or deletion of a child and set the total value in the parent. 
4. use a on record commit trigger to set the total in the parent. 
 

both are methods to avoid the unstored  value  in the parent. 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.