You need to sign in to do that
Don't have an account?
Nagarajan C
Want to get Sobject description in sales force
I want to get description for all object in my salesforce org.
Kindly let me know any posssible way?
Kindly let me know any posssible way?
Hey Nagarajan,
Try this:
// Make the describe call
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
// For each returned result, get some info
for(String objName:gd.keySet()){
Schema.SObjectType sObjType = gd.get(objName);
Schema.DescribeSObjectResult descObj = sObjType.getDescribe();
System.debug('sObject Label: ' + descObj.getLabel());
System.debug('Number of fields: ' + descObj.fields.getMap().size());
System.debug(descObj.isCustom() ? 'This is a custom object.' : 'This is a standard object.');
}