• Nilesh Mendhe
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Salesforce Developer
  • Techila Solutions Pvt. Ltd. Magarpatta, Pune


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

 

I have a list of type String which contains objects of Salesforce like Contact, Account, Opportunity,quote,case etc.

I want to convert the list of string in sObject to use the following line.

 

List<String> a=new List<String>();a.add(sObject.valueOf('Account'));

a.add('Contact');

a.add('opportunity');

a.add('Quote');

a.add('Account');

 

for(String x:a)

{

Map<String,sObjectField> fmap=Schema.sObjectType.x.fields.getMap();

}

// but it  showing error. How i convert a string into Sobject.

 

the red color X is will be string from a list.....

 





  • June 23, 2011
  • Like
  • 0