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
sai manognasai manogna 

will trigger.old throw an error for before insert?

will trigger .old throw an error for before insert?
Raj VakatiRaj Vakati
Yes ..it will through a null pointer exception 

unexpected exception, contact your administrator: TrigUpAcc: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: 
 
trigger TrigUpAcc on Contact (before insert) 
{
   
    for(Contact c : Trigger.new)
    {
       
    }
     for(Contact c : Trigger.old)
    {
        if(c.FirstName!=Null){
            
        }
       
    }
    
    
   
}