Object Schema Details Available Using $ObjectType

Use the $ObjectType global variable to access schema information about the objects in your organization. For example, to access the name, label, and accessibility of an object.

The information available using $ObjectType is a subset of the information available using the Apex describe result, the DescribeSObjectResult system object. This table describes the attributes available from the $ObjectType global variable.

NameData TypeDescription
fieldsSpecialThis attribute can’t be used by itself. Instead, fields should be followed by a field member variable name, and then a field attribute.
fieldSetsSpecialThis attribute can’t be used by itself. Instead, fieldSets should be followed by a field set name, and used in an iteration component.
keyPrefixStringThe three-character prefix code for the object. Record IDs are prefixed with three-character codes that specify the object type. For example, accounts have a prefix of 001 and opportunities have a prefix of 006). $ObjectType returns a value for objects that have a stable prefix. For object types that don’t have a stable or predictable prefix, this field is blank. Pages that rely on these codes can use this way of determining object types to ensure forward compatibility.
labelStringThe object’s label, which often matches the object name. For example, an organization in the medical industry might change the label for Account to Patient. This label matches the one used in the Salesforce user interface.
labelPluralStringThe object’s plural label, which often matches the object name. For example, an organization in the medical industry might change the plural label for Account to Patients. This label matches the one used in the Salesforce user interface.
nameStringThe name of the object.
accessibleBooleantrue if the current user can see this object, false otherwise.
createableBooleantrue if the object can be created by the current user, false otherwise.
customBooleantrue if the object is a custom object, false if it’s a standard object.
deletableBooleantrue if the object can be deleted by the current user, false otherwise.
mergeableBooleantrue if the object can be merged with other objects of its type by the current user, false otherwise.
queryableBooleantrue if the object can be queried by the current user, false otherwise
searchableBooleantrue if the object can be searched by the current user, false otherwise.
undeletableBooleantrue if the object can’t be undeleted by the current user, false otherwise.
updateableBooleantrue if the object can be updated by the current user, false otherwise.

Example fields:

1{!$ObjectType.Account.fields.Name.Label}

Example fieldSets:

1<apex:repeat 
2    value="{!$ObjectType.Contact.FieldSets.properNames}" 
3    var="f">