Created
August 7, 2014 12:11
-
-
Save gdmarsh/ab5b799dfe771e6cda5b to your computer and use it in GitHub Desktop.
Anonymous script to print out list of date fields from a specified sObject
This file contains 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
Map<String, Schema.SObjectField> fieldMap = | |
Schema.SObjectType.Account.fields.getMap(); | |
List<String> fieldNames = new List<String>(); | |
for(Schema.SObjectField fld : fieldMap) { | |
Schema.DescribeFieldResult res = fld.getDescribe(); | |
if(res.getType() == Schema.DisplayType.DATE) { | |
fieldNames.add(res.getName()); | |
} | |
} | |
fieldNames.sort(); | |
for(String s : fieldNames) { | |
System.debug(LoggingLevel.INFO, s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment