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
keertikeerti 

Query on trigger.new

hi,

What is the difference between trigger.new and trigger.old and when to use which one.

bob_buzzardbob_buzzard

The documentation is available here : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables.htm

 

The short version is trigger.old contains the old version of the objects while trigger.new contains the new versions.  you can use these to determine what changes have been made when a record is updated.