Skip to content

Instantly share code, notes, and snippets.

@SalesforceBobLightning
Created May 14, 2019 21:46
Show Gist options
  • Save SalesforceBobLightning/90a097af3863adadd088da7dc735a692 to your computer and use it in GitHub Desktop.
Save SalesforceBobLightning/90a097af3863adadd088da7dc735a692 to your computer and use it in GitHub Desktop.
Get Salesforce SObject fields using Apex
String sObjectName = 'FlowInterview'; // change this
Map<String, SObjectField> fields = Schema.getGlobalDescribe().get(sObjectName).getDescribe().fields.getMap();
for(String key : fields.keySet()) {
System.debug(fields.get(key));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment