Table of Contents


Entity Metadata

Using the entity metadata, you can describe an Entity and access its properties such as entity labels, settings and their fields. Using the "describe" you can also access field details such as picklist values and more.

In order to access Entity metadata, use one of the following methods:

// DiscribeEntity<T> where T is name of the Entity, e.g:var metadata = dbObject.DescribeEntity<Account>();

// You can also ask the system to describe an Entity dynamicallyvar metadata = dbObject.DescribeEntity("Account");

The above sample describes an entity using the current user's permission. Therefore, it would not return fields that the user does not have access to view. If you wish to retrieve the entity details in system mode (where end-user's permissions are ignored), you use the following methods:

// DiscribeEntity<T> where T is name of the Entity, e.g:var metadata = dbObject.DescribeEntity<Account>(true);

// you can also ask the system to describe an Entity dynamicallyvar metadata = dbObject.DescribeEntity("Account", true);

 

Entity Metadata Properties

PropertyProperty TypeNotes
Idstring 
Namestring 
LabelstringTranslated to the current user's preferred language
PluralLabelstringTranslated to the current user's preferred language
KeyPrefixstring 
TracksFeedsbool 
AllowReportsbool 
TrackActivitiesbool 
FieldsList<EntityFieldMetadata>list of fields of the entity
RelationshipsList<EntityRelationshipMetadata>Relationships are other entities that reference this entity

 

Entity Field Metadata Properties

PropertyProperty Type 
Idstring 
Namestring 
LabelstringTranslated to the current user's preferred language
IsKeybool 
IsSearchablebool 
IsReadablebool 
IsReferencebool 
IsAuditFieldbool 
IsReadOnlybool 
IsRequiredbool 
IsExternalIdbool 
IsCalculatedbool 
IsNameFieldbool 
IsCustomFieldbool 
ReferenceFieldstring 
IsAuditedbool 
IsSortablebool 
IsFilterablebool 
IsUniquebool 
IsHtmlbool 
Lengthint 
Precisionint 
IsDepedentPicklistbool 
ControllerNamestring 
PicklistEntriesList<PicklistEntry> 

 

Picklist Entry Properties

PropertyProperty TypeNotes
LabelstringTranslated to the current user's preferred language
ValuestringThe actual value that should be stored in Database.
ExternalValuestring 
IsDefaultValuebool 
ColorstringHEX color value (e.g: #336699)
IsDecisionboolUsed in special use-cases where the picklist value has a certain meaning, such as "Closed" for "Task" means the task is closed and not open anymore.