• Sankar Landa 15
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

trigger AccountContact on Contact (before insert) {
   
 List<Contact> cons=trigger.new;
      for(integer i=1;i<trigger.new.size();i++){
    for(Contact c:cons){
       
    Account acc=[select id,Name from Account  WHERE id=:c.Accountid];
        system.debug('----------------test1--------:'+acc);
        
     system.debug('----------------test1--------:'+i);
            c.Description=acc.Name+'-'+'contact'+i;
            system.debug('----------------test1--------:'+c.Description);
    }   
   
 }
}