function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nagarajan CNagarajan 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?

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.');