I am trying to get describe information about an sObject similar to this:
public Map<String, Schema.SObjectField> fieldMap{get;set;}
fieldMap=Schema.sObjectType.Lead.fields.getMap();
However, I want to substitute my own String variable "Field" instead of "LEAD" which is Standard object name.
myString='Schema.sObjectType.' + Field+ '.fields.getMap();';
fieldMap = myString;
Error Message : : Illegal assignment from String to MAP<String,Schema.SObjectField>
So Is there any Conversion Method for String to Map ? Or Any Suggestions where I can easily assign myString in fieldMap ?