---
schema_version: "1"
id: bacbf14430966f8b0d6f7684aafa1b808334b159d5d6a7cc6923644eb4fea35c
title: DescribeFieldResult Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_methods_system_fields_describe.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 015ed016b85ea2cbdcb857b8a06ef4d2ba14d8dbd3986f2a806e519cb313d322
description: Contains methods for describing sObject fields.For variable-length fields (including binary fields), returns the maximum size of the field, in bytes.Returns the formula specified for this field.Returns the token of the controlling field.Returns the default value for this field.Returns the default formula value that is specified for this formula field.Returns the maximum number of digits specified for the field. This method is only valid with Integer fields.Returns the content of the field-level help.Returns the text label that is displayed next to the field in the Salesforce user interface. This label can be localized.Returns the maximum size of the field for the DescribeFieldResult object in Unicode characters (not bytes).Returns the name of the field, similar to the getName method. However, if the field is part of the current namespace, the namespace portion of the name is omitted.Returns the field name used in Apex.Returns a list of active PicklistEntry objects. A runtime error is returned if the field isn’t a picklist. Only active picklist values are returned.For fields of type Double, returns the maximum number of digits that can be stored, including all numbers to the left and to the right of the decimal point (but excluding the decimal point character).Returns the name of the custom field on the parent standard or custom object whose values are matched against the values of the child external object's indirect lookup relationship field. The match is done to determine which records are related to each other.Returns a list of Schema.sObjectType objects for the parent objects of this field. If the isNamePointing method returns true, there is more than one entry in the list, otherwise there is only one.Returns the name of the child-to-parent relationship.Returns 0 if the field is the primary relationship field or 1 if the field is the secondary relationship field.For fields of type Double, returns the number of digits to the right of the decimal point. Returns one of the SoapType enum values, depending on the type of field.Returns the token for this field.Returns the Salesforce object type from which this field originates.Returns one of the DisplayType enum values, depending on the type of field.Returns true if the current user can see this field, false otherwise.Returns true if the current field is enabled to display Einstein prediction data, false otherwise.Returns true if the field is an Auto Number field, false otherwise.Returns true if the field is a custom formula field, false otherwise. Note that custom formula fields are always read-only.Returns true if the child object is deleted when the parent object is deleted, false otherwise.Returns true if the field is case sensitive, false otherwise.Returns true if the field can be created by the current user, false otherwise.Returns true if the field is a custom field, false if it is a standard field, such as Name.Returns true if the field receives a default value when created, false otherwise.Returns true if the picklist is a dependent picklist, false otherwise.Reserved for future use.Returns true if the field is encrypted with Shield Platform Encryption, false otherwise.Returns true if the field is used as an external ID, false otherwise.Returns true if the field can be used as part of the filter criteria of a WHERE statement, false otherwise.Returns true if null is treated as zero in a formula field, false otherwise.Returns true if the field can be included in the GROUP BY clause of a SOQL query, false otherwise. This method is only available for Apex classes and triggers saved using API version 18.0 and higher.Returns true if the field has been formatted for HTML and should be encoded for display in HTML, false otherwise. One example of a field that returns true for this method is a hyperlink custom formula field. Another example is a custom formula field that has an IMAGE text function.Returns true if the field can be used to specify a record in an upsert method, false otherwise.Returns true if the field is a name field, false otherwise.Returns true if the field can have multiple types of objects as parents. For example, a task can have both the Contact/Lead ID (WhoId) field and the Opportunity/Account ID (WhatId) field return true for this method. because either of those objects can be the parent of a particular task record. This method returns false otherwise.Returns true if the field is nillable, false otherwise. A nillable field can have empty content. A non-nillable field must have a value for the object to be created or saved.Returns true if field permissions can be specified for the field, false otherwise.Returns true if the parent object can't be deleted because it is referenced by a child object, false otherwise.Returns true if the field is a restricted picklist, false otherwiseReturns true if a foreign key can be included in prefiltering when used in a SOSL WHERE clause, false otherwise.Returns true if a query can sort on the field, false otherwiseReturns true if the value for the field must be unique, false otherwiseReturns true if the field can be edited by the current user, or child records in a master-detail relationship field on a custom object can be reparented to different parent records; false otherwise.Returns true if writing to the detail object requires read sharing instead of read/write sharing of the parent.
---
# DescribeFieldResult Class

Contains methods for describing sObject fields.

## Namespace

[Schema](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Schema.htm "The Schema namespace provides classes and methods for schema metadata information.")

## Usage

Instances of field describe results on the same DescribeFieldResult aren’t guaranteed to be equal because the state and behavior of a describe object is determined by various factors including the API version used. To compare describe results, call the getSObjectField() method on the field describe results and use the equality operator (\==) to compare the [SObjectField](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectField.htm#apex_class_Schema_SObjectField "A Schema.sObjectField object is returned from the field describe result using the getController and getSObjectField methods.") values.

## Example

The following is an example of how to instantiate a field describe result object:

Schema.DescribeFieldResult dfr = Account.Description.getDescribe();

## DescribeFieldResult Methods

The following are methods for DescribeFieldResult. All are instance methods.

- **[getByteLength()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getByteLength)**  
    For variable-length fields (including binary fields), returns the maximum size of the field, in bytes.
- **[getCalculatedFormula()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getCalculatedFormula)**  
    Returns the formula specified for this field.
- **[getController()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getController)**  
    Returns the token of the controlling field.
- **[getDefaultValue()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getDefaultValue)**  
    Returns the default value for this field.
- **[getDefaultValueFormula()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getDefaultValueFormula)**  
    Returns the default formula value that is specified for this formula field.
- **[getDigits()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getDigits)**  
    Returns the maximum number of digits specified for the field. This method is only valid with Integer fields.
- **[getInlineHelpText()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getInlineHelpText)**  
    Returns the content of the field-level help.
- **[getLabel()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getLabel)**  
    Returns the text label that is displayed next to the field in the Salesforce user interface. This label can be localized.
- **[getLength()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getLength)**  
    Returns the maximum size of the field for the DescribeFieldResult object in Unicode characters (not bytes).
- **[getLocalName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getLocalName)**  
    Returns the name of the field, similar to the getName method. However, if the field is part of the current namespace, the namespace portion of the name is omitted.
- **[getName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getName)**  
    Returns the field name used in Apex.
- **[getPicklistValues()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getPicklistValues)**  
    Returns a list of active PicklistEntry objects. A runtime error is returned if the field isn’t a picklist. Only active picklist values are returned.
- **[getPrecision()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getPrecision)**  
    For fields of type Double, returns the maximum number of digits that can be stored, including all numbers to the left and to the right of the decimal point (but excluding the decimal point character).
- **[getReferenceTargetField()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getReferenceTargetField)**  
    Returns the name of the custom field on the parent standard or custom object whose values are matched against the values of the child external object's indirect lookup relationship field. The match is done to determine which records are related to each other.
- **[getReferenceTo()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getReferenceTo)**  
    Returns a list of Schema.sObjectType objects for the parent objects of this field. If the isNamePointing method returns true, there is more than one entry in the list, otherwise there is only one.
- **[getRelationshipName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getRelationshipName)**  
    Returns the name of the child-to-parent relationship.
- **[getRelationshipOrder()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getRelationshipOrder)**  
    Returns 0 if the field is the primary relationship field or 1 if the field is the secondary relationship field.
- **[getScale()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getScale)**  
    For fields of type Double, returns the number of digits to the right of the decimal point.
- **[getSOAPType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getSOAPType)**  
    Returns one of the SoapType enum values, depending on the type of field.
- **[getSObjectField()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getSObjectField)**  
    Returns the token for this field.
- **[getSObjectType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getSObjectType)**  
    Returns the Salesforce object type from which this field originates.
- **[getType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_getType)**  
    Returns one of the DisplayType enum values, depending on the type of field.
- **[isAccessible()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isAccessible)**  
    Returns true if the current user can see this field, false otherwise.
- **[isAiPredictionField() (Beta)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isAiPredictionField)**  
    Returns true if the current field is enabled to display Einstein prediction data, false otherwise.
- **[isAutoNumber()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isAutoNumber)**  
    Returns true if the field is an Auto Number field, false otherwise.
- **[isCalculated()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isCalculated)**  
    Returns true if the field is a custom formula field, false otherwise. Note that custom formula fields are always read-only.
- **[isCascadeDelete()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isCascadeDelete)**  
    Returns true if the child object is deleted when the parent object is deleted, false otherwise.
- **[isCaseSensitive()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isCaseSensitive)**  
    Returns true if the field is case sensitive, false otherwise.
- **[isCreateable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isCreateable)**  
    Returns true if the field can be created by the current user, false otherwise.
- **[isCustom()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isCustom)**  
    Returns true if the field is a custom field, false if it is a standard field, such as Name.
- **[isDefaultedOnCreate()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isDefaultedOnCreate)**  
    Returns true if the field receives a default value when created, false otherwise.
- **[isDependentPicklist()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isDependentPicklist)**  
    Returns true if the picklist is a dependent picklist, false otherwise.
- **[isDeprecatedAndHidden()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isDeprecatedAndHidden)**  
    Reserved for future use.
- **[isEncrypted()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#isencrypted)**  
    Returns true if the field is encrypted with Shield Platform Encryption, false otherwise.
- **[isExternalID()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isExternalID)**  
    Returns true if the field is used as an external ID, false otherwise.
- **[isFilterable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isFilterable)**  
    Returns true if the field can be used as part of the filter criteria of a WHERE statement, false otherwise.
- **[isFormulaTreatNullNumberAsZero()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isFormulaTreatNullNumberAsZero)**  
    Returns true if null is treated as zero in a formula field, false otherwise.
- **[isGroupable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isGroupable)**  
    Returns true if the field can be included in the GROUP BY clause of a SOQL query, false otherwise. This method is only available for Apex classes and triggers saved using API version 18.0 and higher.
- **[isHtmlFormatted()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isHtmlFormatted)**  
    Returns true if the field has been formatted for HTML and should be encoded for display in HTML, false otherwise. One example of a field that returns true for this method is a hyperlink custom formula field. Another example is a custom formula field that has an IMAGE text function.
- **[isIdLookup()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isIdLookup)**  
    Returns true if the field can be used to specify a record in an upsert method, false otherwise.
- **[isNameField()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isNameField)**  
    Returns true if the field is a name field, false otherwise.
- **[isNamePointing()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isNamePointing)**  
    Returns true if the field can have multiple types of objects as parents. For example, a task can have both the Contact/Lead ID (WhoId) field and the Opportunity/Account ID (WhatId) field return true for this method. because either of those objects can be the parent of a particular task record. This method returns false otherwise.
- **[isNillable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isNillable)**  
    Returns true if the field is nillable, false otherwise. A nillable field can have empty content. A non-nillable field must have a value for the object to be created or saved.
- **[isPermissionable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isPermissionable)**  
    Returns true if field permissions can be specified for the field, false otherwise.
- **[isRestrictedDelete()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isRestrictedDelete)**  
    Returns true if the parent object can't be deleted because it is referenced by a child object, false otherwise.
- **[isRestrictedPicklist()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isRestrictedPicklist)**  
    Returns true if the field is a restricted picklist, false otherwise
- **[isSearchPrefilterable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isSearchPrefilterable)**  
    Returns true if a foreign key can be included in prefiltering when used in a SOSL WHERE clause, false otherwise.
- **[isSortable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isSortable)**  
    Returns true if a query can sort on the field, false otherwise
- **[isUnique()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isUnique)**  
    Returns true if the value for the field must be unique, false otherwise
- **[isUpdateable()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isUpdateable)**  
    Returns true if the field can be edited by the current user, or child records in a master-detail relationship field on a custom object can be reparented to different parent records; false otherwise.
- **[isWriteRequiresMasterRead()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isWriteRequiresMasterRead)**  
    Returns true if writing to the detail object requires read sharing instead of read/write sharing of the parent.

### getByteLength()

For variable-length fields (including binary fields), returns the maximum size of the field, in bytes.

#### Signature

public Integer getByteLength()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getCalculatedFormula()

Returns the formula specified for this field.

#### Signature

public String getCalculatedFormula()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getController()

Returns the token of the controlling field.

#### Signature

public Schema.sObjectField getController()

#### Return Value

Type: [Schema.SObjectField](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectField.htm#apex_class_Schema_SObjectField "A Schema.sObjectField object is returned from the field describe result using the getController and getSObjectField methods.")

### getDefaultValue()

Returns the default value for this field.

#### Signature

public Object getDefaultValue()

#### Return Value

Type: Object

### getDefaultValueFormula()

Returns the default formula value that is specified for this formula field.

#### Signature

public String getDefaultValueFormula()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getDigits()

Returns the maximum number of digits specified for the field. This method is only valid with Integer fields.

#### Signature

public Integer getDigits()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getInlineHelpText()

Returns the content of the field-level help.

#### Signature

public String getInlineHelpText()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Usage

For more information, see “Define Field-Level Help” in the Salesforce online help.

### getLabel()

Returns the text label that is displayed next to the field in the Salesforce user interface. This label can be localized.

#### Signature

public String getLabel()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Usage

![Note](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/images/icon_note.png)

#### Note

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**.

### getLength()

Returns the maximum size of the field for the DescribeFieldResult object in Unicode characters (not bytes).

#### Signature

public Integer getLength()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getLocalName()

Returns the name of the field, similar to the getName method. However, if the field is part of the current namespace, the namespace portion of the name is omitted.

#### Signature

public String getLocalName()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getName()

Returns the field name used in Apex.

#### Signature

public String getName()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getPicklistValues()

Returns a list of active PicklistEntry objects. A runtime error is returned if the field isn’t a picklist. Only active picklist values are returned.

#### Signature

public List<Schema.PicklistEntry> getPicklistValues()

#### Return Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Schema.PicklistEntry](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_PicklistEntry.htm#apex_class_Schema_PicklistEntry "Represents a picklist entry.")\>

### getPrecision()

For fields of type Double, returns the maximum number of digits that can be stored, including all numbers to the left and to the right of the decimal point (but excluding the decimal point character).

#### Signature

public Integer getPrecision()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getReferenceTargetField()

Returns the name of the custom field on the parent standard or custom object whose values are matched against the values of the child external object's indirect lookup relationship field. The match is done to determine which records are related to each other.

#### Signature

public String getReferenceTargetField()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Usage

For information about indirect lookup relationships, see “Indirect Lookup Relationship Fields on External Objects” in the Salesforce Help.

### getReferenceTo()

Returns a list of Schema.sObjectType objects for the parent objects of this field. If the isNamePointing method returns true, there is more than one entry in the list, otherwise there is only one.

#### Signature

public List <Schema.sObjectType> getReferenceTo()

#### Return Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Schema.sObjectType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectType.htm#apex_class_Schema_SObjectType "A Schema.sObjectType object is returned from the field describe result using the getReferenceTo method, or from the sObject describe result using the getSObjectType method.")\>

#### Versioned Behavior Changes

In API version 51.0 and later, the getReferenceTo() method returns referenced objects that aren’t accessible to the context user. If the context user has access to an object’s field that references another object, irrespective of the context user’s access to the cross-referenced object, the method returns references. In API version 50.0 and earlier, if the context user doesn’t have access to the cross-referenced object, the method returns an empty list.

### getRelationshipName()

Returns the name of the child-to-parent relationship.

#### Signature

public String getRelationshipName()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Usage

For more information about relationships and relationship names, see [Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.264.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm "HTML (New Window)") in the SOQL and SOSL Reference.

### getRelationshipOrder()

Returns 0 if the field is the primary relationship field or 1 if the field is the secondary relationship field.

#### Signature

public Integer getRelationshipOrder()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

#### Usage

For more information about primary and secondary relationships, see [Considerations for Object Relationships](https://help.salesforce.com/s/articleView?id=sf.relationships_considerations.htm&language=en_US "HTML (New Window)"). For more information about relationships and relationship names, see [Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.264.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm "HTML (New Window)") in the SOQL and SOSL Reference.

### getScale()

For fields of type Double, returns the number of digits to the right of the decimal point.

#### Signature

public Integer getScale()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getSOAPType()

Returns one of the SoapType enum values, depending on the type of field.

#### Signature

public Schema.SOAPType getSOAPType()

#### Return Value

Type: [Schema.SOAPType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_Schema_SOAPType.htm "A Schema.SOAPType enum value is returned by the field describe result getSoapType method.")

### getSObjectField()

Returns the token for this field.

#### Signature

public Schema.sObjectField getSObjectField()

#### Return Value

Type: [Schema.SObjectField](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectField.htm#apex_class_Schema_SObjectField "A Schema.sObjectField object is returned from the field describe result using the getController and getSObjectField methods.")

### getSObjectType()

Returns the Salesforce object type from which this field originates.

#### Signature

public Schema.SObjectType getSObjectType()

#### Return Value

Type: [Schema.SObjectType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectType.htm#apex_class_Schema_SObjectType "A Schema.sObjectType object is returned from the field describe result using the getReferenceTo method, or from the sObject describe result using the getSObjectType method.")

#### Example

Schema.DescribeFieldResult f = Account.Industry.getDescribe();
Schema.sObjectType sourceType = f.getSObjectType();
Assert.areEqual(Account.sObjectType, sourceType);

### getType()

Returns one of the DisplayType enum values, depending on the type of field.

#### Signature

public Schema.DisplayType getType()

#### Return Value

Type: [Schema.DisplayType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_Schema_DisplayType.htm "A Schema.DisplayType enum value is returned by the field describe result's getType method.")

### isAccessible()

Returns true if the current user can see this field, false otherwise.

#### Signature

public Boolean isAccessible()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isAiPredictionField() (Beta)

Returns true if the current field is enabled to display Einstein prediction data, false otherwise.

#### Signature

public Boolean isAiPredictionField()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

#### Usage

Custom number fields can be set to display Einstein prediction values. If you are participating in the Einstein Prediction Builder Beta program, use Einstein Prediction Builder to set up the value to display. Use this method to find out if a field is enabled to display an Einstein prediction value.

### isAutoNumber()

Returns true if the field is an Auto Number field, false otherwise.

#### Signature

public Boolean isAutoNumber()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

#### Usage

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.

### isCalculated()

Returns true if the field is a custom formula field, false otherwise. Note that custom formula fields are always read-only.

#### Signature

public Boolean isCalculated()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isCascadeDelete()

Returns true if the child object is deleted when the parent object is deleted, false otherwise.

#### Signature

public Boolean isCascadeDelete()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isCaseSensitive()

Returns true if the field is case sensitive, false otherwise.

#### Signature

public Boolean isCaseSensitive()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isCreateable()

Returns true if the field can be created by the current user, false otherwise.

#### Signature

public Boolean isCreateable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isCustom()

Returns true if the field is a custom field, false if it is a standard field, such as Name.

#### Signature

public Boolean isCustom()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isDefaultedOnCreate()

Returns true if the field receives a default value when created, false otherwise.

#### Signature

public Boolean isDefaultedOnCreate()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

#### Usage

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).

### isDependentPicklist()

Returns true if the picklist is a dependent picklist, false otherwise.

#### Signature

public Boolean isDependentPicklist()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isDeprecatedAndHidden()

Reserved for future use.

#### Signature

public Boolean isDeprecatedAndHidden()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isEncrypted()

Returns true if the field is encrypted with Shield Platform Encryption, false otherwise.

#### Signature

public Boolean isEncrypted()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isExternalID()

Returns true if the field is used as an external ID, false otherwise.

#### Signature

public Boolean isExternalID()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isFilterable()

Returns true if the field can be used as part of the filter criteria of a WHERE statement, false otherwise.

#### Signature

public Boolean isFilterable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isFormulaTreatNullNumberAsZero()

Returns true if null is treated as zero in a formula field, false otherwise.

#### Signature

public Boolean isFormulaTreatNullNumberAsZero()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isGroupable()

Returns true if the field can be included in the GROUP BY clause of a SOQL query, false otherwise. This method is only available for Apex classes and triggers saved using API version 18.0 and higher.

#### Signature

public Boolean isGroupable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isHtmlFormatted()

Returns true if the field has been formatted for HTML and should be encoded for display in HTML, false otherwise. One example of a field that returns true for this method is a hyperlink custom formula field. Another example is a custom formula field that has an IMAGE text function.

#### Signature

public Boolean isHtmlFormatted()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isIdLookup()

Returns true if the field can be used to specify a record in an upsert method, false otherwise.

#### Signature

public Boolean isIdLookup()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isNameField()

Returns true if the field is a name field, false otherwise.

#### Signature

public Boolean isNameField()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

#### Usage

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.

### isNamePointing()

Returns true if the field can have multiple types of objects as parents. For example, a task can have both the Contact/Lead ID (WhoId) field and the Opportunity/Account ID (WhatId) field return true for this method. because either of those objects can be the parent of a particular task record. This method returns false otherwise.

#### Signature

public Boolean isNamePointing()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isNillable()

Returns true if the field is nillable, false otherwise. A nillable field can have empty content. A non-nillable field must have a value for the object to be created or saved.

#### Signature

public Boolean isNillable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isPermissionable()

Returns true if field permissions can be specified for the field, false otherwise.

#### Signature

public Boolean isPermissionable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isRestrictedDelete()

Returns true if the parent object can't be deleted because it is referenced by a child object, false otherwise.

#### Signature

public Boolean isRestrictedDelete()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isRestrictedPicklist()

Returns true if the field is a restricted picklist, false otherwise

#### Signature

public Boolean isRestrictedPicklist()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isSearchPrefilterable()

Returns true if a foreign key can be included in prefiltering when used in a SOSL WHERE clause, false otherwise.

#### Signature

public Boolean isSearchPrefilterable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

#### Usage

_Prefiltering_ means to filter by a specific field value before executing the full search query. Prefiltering is supported only in WHERE clauses with the equals (\=) operator.

### isSortable()

Returns true if a query can sort on the field, false otherwise

#### Signature

public Boolean isSortable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isUnique()

Returns true if the value for the field must be unique, false otherwise

#### Signature

public Boolean isUnique()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isUpdateable()

Returns true if the field can be edited by the current user, or child records in a master-detail relationship field on a custom object can be reparented to different parent records; false otherwise.

![Important](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

#### Signature

public Boolean isUpdateable()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

### isWriteRequiresMasterRead()

Returns true if writing to the detail object requires read sharing instead of read/write sharing of the parent.

#### Signature

public Boolean isWriteRequiresMasterRead()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")