Last active
November 27, 2016 06:01
-
-
Save nithesh1992/ad1342b483372c40488426130f8747e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SalesForce Apex Code | |
List<Schema.SObjectType> AllSobjects = Schema.getGlobalDescribe().Values(); // Getting All sObjects available. | |
List<String> AllSobjectsNames = new List<String>(); | |
for(Schema.SObjectType sObj : AllSobjects) { | |
AllSobjectsNames.add(sObj.getDescribe().getName()); | |
} // Getting All sObjects Names available. | |
System.debug(' **Total sObject Count: ' + AllSobjectsNames.size()); | |
SObjectType acc = Schema.getGlobalDescribe().get('Account'); // Account sObject is just hardcoded here..Can use any sObject Name. | |
Map<String,Schema.SObjectField> allFields = acc.getDescribe().fields.getMap(); //All fields as a map. | |
System.debug(' **Total field Count: ' + allFields.size()); | |
for(String sfield : allFields.keyset()) { | |
System.debug('--> '+ allFields.get(sField)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment