Newer Version Available
FieldDefinition
This object is available in API version 32.0 and later.
Supported SOAP Calls
query()
describeSObject()
Supported REST HTTP Methods
GET
Fields
| Field | Details | |
|---|---|---|
| BusinessOwnerId |
|
|
| BusinessStatus |
|
|
| CompactLayoutItems |
|
|
| ComplianceGroup |
|
|
| ControlledFields |
|
|
| ControllingFieldDefinition |
|
|
| ControllingFieldDefinitionId |
|
|
| DataType |
|
|
| DeveloperName |
|
|
| DurableId |
|
|
| EntityDefinition |
|
|
| EntityDefinitionId |
|
|
| ExtraTypeInfo |
|
|
| FullName |
|
|
| IsApiFilterable |
|
|
| IsApiGroupable |
|
|
| IsApiSortable |
|
|
| IsCalculated |
|
|
| IsCompactLayoutable |
|
|
| IsFieldHistoryTracked |
|
|
| IsFlsEnabled |
|
|
| IsHighScaleNumber |
|
|
| IsHtmlFormatted |
|
|
| IsIndexed |
|
|
| IsListFilterable |
|
|
| IsListSortable |
|
|
| IsListVisible |
|
|
| IsNameField |
|
|
| IsNillable |
|
|
| IsPolymorphicForeignKey |
|
|
| IsSearchPrefilterable |
|
|
| IsWorkflowFilterable |
|
|
| Label |
|
|
| Length |
|
|
| LookupFilters |
|
|
| MasterLabel |
|
|
| Metadata |
|
|
| NamespacePrefix |
|
|
| Particles |
|
|
| Precision |
|
|
| Publisher |
|
|
| PublisherId |
|
|
| QualifiedApiName |
|
|
| ReferenceTargetField |
|
|
| ReferenceTo |
|
|
| RelationshipDomains |
|
|
| RelationshipName |
|
|
| RunningUserFieldAccessId |
|
|
| Scale |
|
|
| SecurityClassification |
|
|
| ServiceDataType |
|
|
| ServiceDataTypeId |
|
|
| ServiceDataTypes |
|
|
| ValueType |
|
|
| ValueTypeId |
|
|
| WorkflowFieldUpdates |
|
Example Query: Find Parent Object Types
Some fields can have more than one type of object in a relationship (polymorphic). For example, Task and Event can have relationships with Contact or Lead.
Use this query to retrieve a list of objects that can have a relationship with the FieldDefinition.
Example Query: Find the Datatypes for Account Fields
CustomField Metadata
| Field Name | Field Type | Description |
|---|---|---|
| caseSensitive | boolean | Indicates whether the field is case sensitive (true) or not (false). For indirect lookup relationship fields on external objects, this attribute affects how this custom field’s values are matched against the values of referenceTargetField. |
| defaultValue | string | If specified, represents the default value of the field. |
| deleteConstraint | DeleteConstraint is an enumeration of strings |
Provides deletion options for lookup
relationships. Valid values are:
For more information on lookup relationships, see “Object Relationships” in the Salesforce Help. |
| description | string | Description of the field. |
| displayFormat | string | The display format. |
| displayLocationInDecimal | boolean | Indicates how the value of a Geolocation custom field appears in the user interface. If true, the geolocation appears in decimal notation. If false, the geolocation appears as degrees, minutes, and seconds. |
| externalDeveloperName | string | Available only for external objects. Name of the table column on the external data source that maps to this custom field in Salesforce. Corresponds to External Column Name in the user interface. This field is available in API version 32.0 and later. |
| externalId | boolean | Indicates whether the field is an external ID field (true) or not (false). |
| formula | string | If specified, represents a formula on the field. |
| formulaTreatBlankAs | TreatBlanksAs | Indicates how to treat blanks in a formula. Valid values are BlankAsBlank or BlankAsZero. |
| fullName | string | Required. The internal name of the object. White spaces and special
characters are escaped for validity. The name must:
|
| indexed | boolean | Indicates if the field is indexed. If this field is unique or the externalId is set true, the isIndexed value is set to true. This field has been deprecated as of version 14.0 and is only provided for backward compatibility. |
| inlineHelpText | string | Represents the content of field-level help. For more information, see “Define Field-Level Help” in the Salesforce Help. |
| isFilteringDisabled | boolean | Available only for external objects. Indicates whether the custom field is available in filters. This field is available in API version 32.0 and later. |
| isNameField | boolean | Available only for external object fields of type text. For each external object, you can specify one field as the name field. If you set this field's value to true, make sure that the external table column identified by externalDeveloperName contains name values. This field is available in API version 32.0 and later. |
| isSortingDisabled | boolean | Available only for external objects. Indicates whether the custom field is sortable. This field is available in API version 32.0 and later. |
| reparentableMasterDetail | boolean |
Indicates whether the
child records in a master-detail relationship on a custom object
can be reparented to different parent records. The default value
is false. This field is available in API version 25.0 and later. |
| label | string | Label for the field. You cannot update the label for standard picklist fields, such as the Industry field for accounts. |
| length | int | Length of the field. |
| lookupFilter | LookupFilter | The Lookup filter definition for the custom field. Available in API version 30.0 and later. |
| maskChar | EncryptedFieldMaskChar | For encrypted fields, specifies the character to be used as a
mask. Valid values are:
|
| maskType | EncryptedFieldMaskType | For encrypted text fields, specifies the format of the masked and
unmasked characters in the field. Valid values:
|
| picklist | Picklist | If specified, the field is a picklist, and this field enumerates the picklist values and labels. |
| populateExistingRows | boolean | Indicates whether existing rows are populated (true) or not (false). |
| precision | int | The precision for number values. Precision is the number of digits in a number. For example, the precision value for the number 256.99 is 5. |
| referenceTargetField | string | Available only for indirect lookup relationship fields on external objects. Specifies the custom field on the parent object to match against this indirect lookup relationship field, whose values come from an external data source. The specified custom field on the parent object must have both externalId and unique set to true. This field is available in API version 32.0 and later. |
| referenceTo | string | If specified, indicates a reference this field has to another object. |
| relationshipLabel | string | Label for the relationship. |
| relationshipName | string | If specified, indicates the value for one-to-many relationships. For example, in the object MyObject that had a relationship to YourObject, the relationship name YourObjects makes the relationship type obvious. |
| relationshipOrder | int |
This field is valid for all
master-detail relationships, but the value is only non-zero for
junction objects. A junction object has two master-detail
relationships, and is analogous to an association table in a
many-to-many relationship. Junction objects must define one
parent object as primary (0), the other as secondary (1). The
definition of primary or secondary affects delete behavior and
inheritance of look and feel, and record ownership for junction
objects. For more information, see the Salesforce Help. 0 or 1 are the only valid values, and 0 is always the value for objects that are not junction objects. |
| required | boolean | Indicates whether the field requires a value on creation (true) or not (false). |
| scale | int | The scale for the field. Scale is the number of digits to the right of the decimal point in a number. For example, the number 256.99 has a scale of 2. |
| startingNumber | int | If specified, indicates the starting number for the field. |
| stripMarkup | boolean | Set to true to remove markup, or false to preserve markup. Used when converting a rich text area to a long text area. |
| summarizedField | string | Represents the field on the detail row that is being summarized. This field cannot be null unless the value of SummaryOperation is count. |
| summaryForeignKey | string | Represents the master-detail field on the child that defines the relationship between the parent and the child. |
| summaryOperation | SummaryOperations is an enumeration of strings | Represents the sum operation to be performed. Valid values are:
|
| trackFeedHistory | boolean |
Indicates whether the field is
enabled for feed tracking (true) or not (false).
This field is available in API version 18.0 and later. |
| trackHistory | boolean | Indicates whether history tracking is enabled for the field (true) or not (false). Also available for standard object fields (picklist and lookup fields only) in API version 30.0 and later. |
| trackTrending | boolean | Indicates whether historical trending data is captured for the field (true) or not (false). If this attribute is true for at least one field, the object is enabled for historical trending. Available in API version 29.0 and later. |
| trueValueIndexed | boolean | This field is only relevant for a checkbox field. If set, true values are built into the index. This field has been deprecated as of API version 14.0 and is only provided for backward compatibility. |
| type | FieldType is an enumeration of strings | Indicates the field type for the field. Valid values are:
For standard fields on standard objects, the type field is optional. This field is included for some standard field types, such as Picklist or Lookup, but not for others. The type field is included for custom fields. |
| unique | boolean | Indicates whether the field is unique (true) or not (false). |
| visibleLines | int | Indicates the number of lines displayed for the field. |
| writeRequiresMasterRead | boolean |
Sets the minimum sharing
access level required on the master record to create, edit, or
delete child records. This field applies only to master-detail
or junction object custom field types.
For junction objects, the most restrictive access from the two parents is enforced. For example, you set to true on both master-detail fields, but users have “Read” access to one master record and “Read/Write” access to the other master record. In this example, users are unable to create, edit, or delete child records. |
Picklist Metadata
| Field Name | Field Type | Description |
|---|---|---|
| controllingField | string | The fullName of the controlling field if this field is a dependent picklist. A dependent picklist works with a controlling picklist or checkbox to filter the available options. The value chosen in the controlling field affects the values available in the dependent field. This field is available in API version 14.0 and later. |
| picklistValues | PicklistValue[] |
Required. Represents a set of values for a picklist. |
| sorted | boolean |
Required. Indicates whether values are sorted (true), or not (false). |
PicklistValue Metadata
This metadata type defines a value in the picklist and specifies whether this value is the default value. This type extends Metadata and inherits its fullName field.
Note the following when working with picklist values:
- When you retrieve a standard object, you all picklist values are retrieved, not just the customized picklist values.
- When you deploy changes to standard picklist fields, picklist values are added as needed.
- You can’t set a picklist value as inactive, but if the picklist value is missing and you invoke an update() call, the missing value becomes inactive.