The simple apex script to generate Salesforce data dictionary was born from a personal need to make the workflow as simple as one-click. The code is meant to run in anonymous window inside of Salesforce developer console making the whole process ephemeral. Please do try this code in a sandbox or a dev org.
- Open Developer Console
- Open Anonymous Window
- Copy and paste DataDictionary.cls
- Remove all the comments
- RUN
- Open Files tab
- You will see the exported Data Dictionary - on the top of Owned By Me files
- The rest is up to your artistic expression with Excel formatting
---> See the output from Salesforce dev org sample.
String[] sObjectTypes = new String[]{'Account','Contact','Lead','Opportunity','Campaign','CampaignMember'};
- Replace the existing string values (ex. 'Account') of the sObjectTypes array to the API Names of sObjects you wish to retrieve.
- Extract a set of five sObjects at a time for sObject containing less than 200 fields. Cut down the number of sObject per transaction if each sObject contains more than 300+ fields and you do not love LOADING........1%...2%..3%. You get the idea.
- The final output does not include every info from the field definition.