Newer Version Available

This content describes an older version of this product. View Latest

EntityParticle

Represents each element of a field that can be presented in a user interface. Contrast EntityParticle with FieldDefinition, which represents each element of a field defined in the Metadata API. EntityParticle has parity with describe. Available in Tooling API version 34.0 and later.

Supported SOAP Calls

query()

Supported REST HTTP Methods

GET

Fields

Field Details
ByteLength
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The maximum length of the field represented by this EntityParticle, in bytes.
DataType
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Data type of the field, for example Text(40) or Date/Time. The values are defined as they are in the user interface, not the corresponding API data type names.
For example, from an object, retrieve all the fields of one datatype.
1SELECT DataType, QualifiedApiName 
2FROM EntityParticle 
3WHERE DataType = 'phone' AND
4      EntityDefinition.QualifiedApiName = 'Account'
DefaultValueFormula
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The default value specified for the field when a formula isn’t specified. If no default value has been specified, this field is not returned.
DeveloperName
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization. Label is Record Type Name.
Digits
Type
int
Properties
Filter, Group, Nillable, Sort
Description
Maximum number of digits for a field of type int. If an integer value exceeds the number of digits, the API returns an error.
DurableId
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Unique identifier for the field. Always retrieve this value before using it, as the value isn’t guaranteed to stay the same from one release to the next. To simplify queries, use this field.
EntityDefinitionId
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The ID for the object defined in the DurableId field.
ExtraTypeInfo
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Represents further definition of a type.
  • For type textarea:
    • plaintextarea
    • richtextarea
  • For type URL:
    • image
  • For type reference:
    • externallookup
    • indirectlookup
  • For Account:
    • switchablepersonname
    • personname
FieldDefinitionId
Type
string
Properties
Filter, Group, Nillable, Sort
Description
ID of the field definition associated with this EntityParticle.
InlineHelpText
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Represents the content of field-level help.
Restrictions
Available in Tooling API starting version 35.0.
IsApiFilterable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field represented by this EntityParticle can be specified in the WHERE clause of a query string.
Restrictions
You can't sort or filter compound fields. This field’s value is always false for compound fields.
IsApiGroupable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field represented by this EntityParticle can be included in the GROUP BY clause of a SOQL query.
IsApiSortable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, a query can sort on the field represented by this EntityParticle.
Restrictions
You can't sort or filter compound fields. This field’s value is always false for compound fields.
IsAutoNumber
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field’s value is automatically assigned when the record is created.
Restrictions
Available in Tooling API starting version 35.0.
IsCalculated
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field represented by this EntityParticle is calculated.
IsCaseSensitive
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field represented by this EntityParticle is case sensitive.
Restrictions
Available in Tooling API starting version 35.0.
IsCompactLayoutable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field can be included in a compact layout.
IsCompound
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field is a compound of other fields. The default value is false. Available in Tooling API starting version 38.0.
IsCreatable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, a value for the field represented by this EntityParticle can be created.
Restrictions
Available in Tooling API starting version 35.0.
IsDefaultedOnCreate
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, and if no other value is supplied, a default value is applied when the record is created.
Restrictions
Available in Tooling API starting version 35.0.
IsDependentPicklist
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field is a dependent picklist.
Restrictions
Available in Tooling API starting version 35.0.
IsDeprecatedAndHidden
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Reserved for future use.
IsDisplayLocationInDecimal
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, and if the field represented by this EntityParticle is a Geolocation custom field, the value appears in decimal notation. If false, the value appears as degrees, minutes, and seconds.
Restrictions
This field has no affect on custom fields that aren’t Geolocation fields.
Available in Tooling API starting version 35.0.
IsEncrypted
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field is marked for Classic Encryption.
Restrictions
Available in Tooling API starting version 35.0.
IsFieldHistoryTracked
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field’s history can be tracked.
IsHighScaleNumber
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the field stores numbers to 8 decimal places regardless of what’s specified in the field details (true) or not (false). Used to handle currencies for products that cost fractions of a cent, in large quantities. If high-scale unit pricing isn’t enabled in your organization, this field isn’t returned.
IsHTMLFormatted
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field contains HTML.
IsIdLookup
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, you can use the field to specify a record for upsert.
Restrictions
Available in Tooling API starting version 35.0.
IsLayoutable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field can be assigned to a layout.
Restrictions
Available in Tooling API starting version 35.0.
IsListVisible
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field can be included in a related list.
IsNameField
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field is a name field.
IsNamePointing
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field represents a polymorphic relationship. Determine the object type at runtime for dynamic queries when this value is true.
Restrictions
Available in Tooling API starting version 35.0.
IsNillable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field can be left out of queries on the object.
IsPermissionable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, you can specify field permissions for the field.
Restrictions
Available in Tooling API starting version 35.0.
IsUnique
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field is unique.
Restrictions
Available in Tooling API starting version 35.0.
IsUpdatable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, you can update the field.
Restrictions
Available in Tooling API starting version 35.0.
IsWorkflowFilterable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, the field can be filtered for a workflow.
IsWriteRequiresMasterRead
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
If true, writing to the detail object requires read sharing instead of read-write sharing of the parent.
Restrictions
Available in Tooling API starting version 35.0.
Label
Type
string
Properties
Filter, Group, Sort
Description
The label that corresponds to the field in the user interface. If the label has translations, the label returned is in the user’s language.
Length
Type
int
Properties
Filter, Group, Sort
Description
The maximum number of bytes available to store the value in the field represented by this EntityParticle.
Mask
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Reserved for future use.
MaskType
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Reserved for future use.
MasterLabel
Type
string
Properties
Filter, Group, Sort
Description
Master label for this object. This display value is the internal label that is not translated. Limit: 40 characters.
Name
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Name of the object for the field represented by this EntityParticle.
Restrictions
This field is available in API version 35.0 and later.
NamespacePrefix
Type
string
Properties
Filter, Group, Sort
Description
The namespace prefix associated with this object. Each Developer Edition organization that creates a managed package has a unique namespace prefix. Limit: 15 characters. You can refer to a component in a managed package by using the namespacePrefix__componentName notation.

The namespace prefix can have one of the following values:

  • In Developer Edition organizations, the namespace prefix is set to the namespace prefix of the organization for all objects that support it. There is an exception if an object is in an installed managed package. In that case, the object has the namespace prefix of the installed managed package. This field’s value is the namespace prefix of the Developer Edition organization of the package developer.
  • In organizations that are not Developer Edition organizations, NamespacePrefix is only set for objects that are part of an installed managed package. There is no namespace prefix for all other objects.
Precision
Type
int
Properties
Filter, Group, Sort
Description
The maximum number of digits allowed for the field represented by this EntityParticle.
QualifiedApiName
Type
string
Properties
Filter, Group, Sort
Description
A unique external name for the field.
ReferenceTargetField
Type
string
Properties
Filter, Group, Nillable, Sort
Description
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 IsIdLookup and IsUnique set to true.
Restrictions
Available only if the field represented by this EntityParticle is an indirect lookup relationship field on an external object.
This field is available in API version 35.0 and later.
ReferenceTo
Type
RelationshipReferenceTo
Properties
Nillable
Description
The array of values in this field represents the possible object types of the referenced objects. For example, if EntityParticle represents a field on Events, the values are Contact, Lead, and custom objects with a relationship to Events.
RelationshipName
Type
string
Properties
Filter, Group, Nillable, Sort
Description
If the field represented by this EntityParticle is a master-detail relationship field, this field’s value is the relationship name.
RelationshipOrder
Type
int
Properties
Filter, Group, Nillable, Sort
Description
A value of 0 represents a primary relationship, and a value of 1 represents a secondary relationship. This field is relevant only for relationship fields.
Scale
Type
int
Properties
Filter, Group, Sort
Description
The number of digits to the right of the decimal in an integer. For example, 3.00 has a scale of 2.
ValueTypeId
Type
string
Properties
Filter, Group, Nillable, Sort
Description
ID of the value type, if any, for the field represented by this EntityParticle.

EntityParticle fields are exposed in SOAP API version 45.0 and later. You can use Tooling API to query for EntityParticle fields in guest user mode in API version 44.0 and earlier. In API version 45.0 and later, use SOAP API to get this data in guest user mode. EntityParticle is still exposed in Tooling API to User Profiles with the ViewSetup permission.

Note

RelationshipReferenceTo Type

Represents the set of objects that this EntityParticle can have a relationship with.

Field Type Details
referenceTo string[]

The name of an object that can be referenced. For example, if EntityParticle represents Event.WhoId (the WhoId field on Event), the value of this field would be at least [Contact, Lead].

Example Query: Retrieve All Account Fields

1SELECT DataType, FieldDefinition.QualifiedApiName 
2FROM EntityParticle 
3WHERE EntityDefinition.QualifiedApiName ='Account'
4            

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 Event.WhoId (represented by EntityParticle).
1SELECT QualifiedApiName, RelationshipName, ReferenceTo, ReferenceTargetField 
2FROM EntityParticle
3WHERE EntityDefinition.QualifiedApiName = 'Event' AND QualifiedApiName = 'WhoId'