• Mr Sreenivias
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
 list<account> acc= [select id from account where name='wipro' ];
list<contact> cons=  new list<contact>();
for(list<account> a : acc)
  { 
     contact con = new contact();
      con.firstname='schnider';
      con.lastname='electrics';
      con.AccountId=acc.Id;
      cons.add(con);
            
     }
insert cons;



how to solve it 
 list<account> acc= [select id from account where name='wipro' ];
list<contact> cons=  new list<contact>();
for(list<account> a : acc)
  { 
     contact con = new contact();
      con.firstname='schnider';
      con.lastname='electrics';
      con.AccountId=acc.Id;
      cons.add(con);
            
     }
insert cons;



how to solve it 
I am getting this error on the following code

 
String recordTypeName = [Select Name from RecordType where Id=:theCase.recordTypeId and SObjectType = 'Case' limit 1]];

What am I doing wrong?