+ Start a Discussion
Rich13Rich13 

How to creat a cumulative field?

Hi,

I would like create a fied that add numbers in a cumulative way.

Example: I update a set of records with the help of Lead ID giving 10 as score in the Score filed. In my next update I get a set of records to update the score as 10 once again. But if the 2nd set has the same record which has got updated in the first Set should get 20 score in the Score filed.

In this way the score field shold have cumulative addition. Please suggest a workaround for this.

Thank you.

Sonam_SFDCSonam_SFDC
You can create an after update  trigger on this object for this requirement such that the value of the field which is changed to the new value can be calculated using trigger.old .

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables.htm