Skip to main content
3 respostas
  1. 4 de jun. de 2014, 10:25
    Hi natalia check this code

     

    set<id> set1=new set<id>();

     

    list<contact>conlist=[select id,name from contact where name='Ashok143'];

     

    for(contact con:conlist)

     

    {

     

       set1.add(con.accountid);

     

    }

     

    list<account> acclist=[select id,name from account where id in:set1];

     

    for(account acc:acclist)

     

    {

     

       acc.name='ram';

     

       update acc;

     

      system.debug('account  record is'+acc);

     

    }

     

    //accountname=ashok143

     

    let change the account name as  Ram
0/9000