Skip to content

Instantly share code, notes, and snippets.

@escgeek
Created December 6, 2017 18:18
Show Gist options
  • Save escgeek/f7388c135a6ce2197baf46228da5bf9f to your computer and use it in GitHub Desktop.
Save escgeek/f7388c135a6ce2197baf46228da5bf9f to your computer and use it in GitHub Desktop.
map<String, Schema.SObjectField> sMap = Schema.SObjectType.Account.fields.getMap();
map<String, String> fieldMap = new map<String, String>();
for(String s : sMap.keySet())
{
fieldMap.put(sMap.get(s).getDescribe().getLabel(), sMap.get(s));
system.debug('Field Name: ' + sMap.get(s).getDescribe().getLabel() + ' - API Name: ' + sMap.get(s));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment