Schema.DescribeFieldResult dfr = Account.Description.getDescribe();
The following are methods for DescribeFieldResult. All are instance methods.
public Integer getByteLength()
Type: Integer
public String getCalculatedFormula()
Type: String
public Schema.sObjectField getController()
Type: Schema.SObjectField
public Object getDefaultValue()
Type: Object
public String getDefaultValueFormula()
Type: String
public Integer getDigits()
Type: Integer
public String getInlineHelpText()
Type: String
For more information, see “Define Field-Level Help” in the Salesforce online help.
public String getLabel()
Type: String
For the Type field on standard objects, getLabel returns a label different from the default label. It returns a label of the form Object Type, where Object is the standard object label. For example, for the Type field on Account, getLabel returns Account Type instead of the default label Type. If the Type label is renamed, getLabel returns the new label. You can check or change the labels of all standard object fields from Setup by entering Rename Tabs and Labels in the Quick Find box, then selecting Rename Tabs and Labels.
public Integer getLength()
Type: Integer
For example, the length of the FinancialPackage__Account_Id field is 27, so getLength() returns 27 for this field. However, the length of the FinancialPackage__Account_Revenue_Forecast__c field is 45, so getLength() returns 40 in this case.
public String getLocalName()
Type: String
public List<Schema.PicklistEntry> getPicklistValues()
Type: List<Schema.PicklistEntry>
public Integer getPrecision()
Type: Integer
public String getReferenceTargetField()
Type: String
For information about indirect lookup relationships, see “Indirect Lookup Relationship Fields on External Objects” in the Salesforce Help.
public List <Schema.sObjectType> getReferenceTo()
Type: List<Schema.sObjectType>
public String getRelationshipName()
Type: String
For more information about relationships and relationship names, see Understanding Relationship Names in the SOQL and SOSL Reference.
public Integer getRelationshipOrder()
Type: Integer
For more information about relationships and relationship names, see Understanding Relationship Names in the SOQL and SOSL Reference.
public Integer getScale()
Type: Integer
This method returns a fault response if the number has too many digits to the left of the decimal point.
public Schema.SOAPType getSOAPType()
Type: Schema.SOAPType
public Schema.sObjectField getSObjectField()
Type: Schema.SObjectField
public Schema.DisplayType getType()
Type: Schema.DisplayType
public Boolean isAccessible()
Type: Boolean
public Boolean isAiPredictionField()
Type: Boolean
public Boolean isAutoNumber()
Type: Boolean
Analogous to a SQL IDENTITY type, Auto Number fields are read-only, non-createable text fields with a maximum length of 30 characters. Auto Number fields are used to provide a unique ID that is independent of the internal object ID (such as a purchase order number or invoice number). Auto Number fields are configured entirely in the Salesforce user interface.
public Boolean isCalculated()
Type: Boolean
public Boolean isCascadeDelete()
Type: Boolean
public Boolean isCaseSensitive()
Type: Boolean
public Boolean isCreateable()
Type: Boolean
public Boolean isCustom()
Type: Boolean
public Boolean isDefaultedOnCreate()
Type: Boolean
If this method returns true, Salesforce implicitly assigns a value for this field when the object is created, even if a value for this field is not passed in on the create call. For example, in the Opportunity object, the Probability field has this attribute because its value is derived from the Stage field. Similarly, the Owner has this attribute on most objects because its value is derived from the current user (if the Owner field is not specified).
public Boolean isDependentPicklist()
Type: Boolean
public Boolean isDeprecatedAndHidden()
Type: Boolean
public Boolean isExternalID()
Type: Boolean
public Boolean isFilterable()
Type: Boolean
public Boolean isFormulaTreatNullNumberAsZero()
Type: Boolean
public Boolean isGroupable()
Type: Boolean
public Boolean isHtmlFormatted()
Type: Boolean
public Boolean isIdLookup()
Type: Boolean
public Boolean isNameField()
Type: Boolean
This method is used to identify the name field for standard objects (such as AccountName for an Account object) and custom objects. Objects can only have one name field, except where the FirstName and LastName fields are used instead (such as on the Contact object).
If a compound name is present, for example, the Name field on a person account, isNameField is set to true for that record.
public Boolean isNamePointing()
Type: Boolean
public Boolean isNillable()
Type: Boolean
public Boolean isPermissionable()
Type: Boolean
public Boolean isRestrictedDelete()
Type: Boolean
public Boolean isRestrictedPicklist()
Type: Boolean
public Boolean isSearchPrefilterable()
Type: Boolean
Prefiltering means to filter by a specific field value before executing the full search query.
public Boolean isSortable()
Type: Boolean
public Boolean isUnique()
Type: Boolean
public Boolean isUpdateable()
Type: Boolean
public Boolean isWriteRequiresMasterRead()
Type: Boolean