You need to sign in to do that
Don't have an account?
dke01
Dynamic getDescribe()
There are alot of example of people using the below code
Map<String, Schema.SObjectField> M = Lead.sObjectType.getDescribe().fields.getMap();
What I want to do is instead of Hard Coding the sObject in this Case Lead pass it as a string paramater
so how would I do something like
GetType('MySobject__c').getDescribe().fields.getMap();
Ok I found another post with the answer
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); Schema.SObjectType ctype = gd.get('contact'); Map<String, Schema.SobjectField> fmap = ctype.getDescribe().fields.getMap();
describeSObjects()