+ 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.