Skip to content

Instantly share code, notes, and snippets.

@mtetlow
Created December 5, 2014 14:50
Show Gist options
  • Save mtetlow/3cc4551173a263022d16 to your computer and use it in GitHub Desktop.
Save mtetlow/3cc4551173a263022d16 to your computer and use it in GitHub Desktop.
example of field describes to get a field name
Schema.DescribeSObjectResult d = Schema.getGlobalDescribe().get('Task').getDescribe();
Map<String,sObjectField> fields = d.fields.getMap();
for (String f : fields.keyset() ) {
Schema.DescribeFieldResult dfr = fields.get(f).getDescribe();
//system.debug(JSON.serialize(dfr));
system.debug(dfr.Name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment