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

Trigger update problem

        I have write one trigger for custom object Project__c. When I update Savings__c field that value is added into another custom object field Work__c.Overall_Savings__c..
       I want to know fetch before update value and after update value..
That is
             before update Savings__c =5
             After update I have changed into 10
            means  how can I fetch 5 and 10..
because before update  overall_savings__c =50
               After update Overall_Savings__c =55
That is I have to add just difference value to Work__c object field Overall_Savings__c...
Any one have a sample code please post me

For your issue you can use: Old and new trigger values.

Eg. and trigger.old.Savings__c for retrieving the new and old values respectively.

Hope this solves your problem.
Hi.. Pallav..
     Thanks for ur reply.. and trigger.old.Savings__c (both) returns currently entered value.. That is 10 in my example...
Can u tell any other suggestion..