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
VisualForceVisualForce 

Trigger update problem

Hi..
 
        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
 
 
     
         
PallavPallav
Hi,

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

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

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