Soubhik
12/21/2019 - 10:33 AM

Example 4

Update Copy Account

trigger UpdateCopyAccount on Account (before update) {
    
    
    for(Account acc : trigger.new)
    {
        System.debug('new value'+acc.name);
    }
    
    for(Account acc : trigger.old)
    {
        CopyAccount__c ca = new CopyAccount__c();
         ca.name=  acc.name;
        System.debug('old value'+acc.name);
        insert ca;
        
    }

}