View

Wednesday, May 1, 2013

Apex Code : Converting one object to Another.............



trigger Helloworld on Lead (before insert)
{
  for(Lead l: Trigger.New)
  {
    l.Hello__c = 'Surendharan';
    Contact  c = new Contact(LastName= l.LastName);
    insert c;
    if(l.College__c !=null)
    {
      Account a = new Account(Name= l.College__c);
    insert a;
    }
  }
}



01590000000FYtQ


Security Token:  

User Name: sampath@offline.com
Security Token: wEToynf7jsZsxbmWjrPypcoWi



User Name: an.nagalakshmanan@gmail.com
Security Token: 9zMv5Ni7EdShLDQLF9hxO7xA
Password: navavi28

No comments:

Post a Comment

Share your Comments .............