function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Sum up values in fields

Trying to find a way to sum up the values in a group of custom fields on a custom object. There's no master-detail so I can't use a Roll-up summary field. Is there anyway to handle this in Apex? There's about 30 fields I want to add together.




Are you saying you want to have a field on your custom object that is the sum of other fields in the same object?

For that you probably want to use a formula field.




No, this would be apex code to sum up the values.