Newer Version Available
DescribeSObjectResult Class
Namespace
Usage
None of the methods take an argument.
DescribeSObjectResult Methods
The following are methods for DescribeSObjectResult. All are instance methods.
fields
Signature
public Schema.SObjectTypeFields fields()
Return Value
Type: The return value is a special data type. See the example to learn how to use fields.
Usage
Example
1Schema.DescribeFieldResult dfr = Schema.SObjectType.Account.fields.Name;To get a custom field name, specify the custom field name.
fieldSets
Signature
public Schema.SObjectTypeFields fieldSets()
Return Value
Type: The return value is a special data type. See the example to learn how to use fieldSets.
getChildRelationships()
Signature
public Schema.ChildRelationship getChildRelationships()
Return Value
Type: List<Schema.ChildRelationship>
Example
For example, the Account object includes Contacts and Opportunities as child relationships.
getHasSubtypes()
Signature
public Boolean getHasSubtypes()
Return Value
Type: Boolean
getKeyPrefix()
Signature
public String getKeyPrefix()
Return Value
Type: String
Usage
The DescribeSobjectResult object returns a value for objects that have a stable prefix. For object types that do not have a stable or predictable prefix, this field is blank. Client applications that rely on these codes can use this way of determining object type to ensure forward compatibility.
getLabel()
Signature
public String getLabel()
Return Value
Type: String
Usage
The object's label might not always match the object name. For example, an organization in the medical industry might change the label for Account to Patient. This label is then used in the Salesforce user interface. See the Salesforce online help for more information.
getLabelPlural()
Signature
public String getLabelPlural()
Return Value
Type: String
Usage
The object's plural label might not always match the object name. For example, an organization in the medical industry might change the plural label for Account to Patients. This label is then used in the Salesforce user interface. See the Salesforce online help for more information.
getLocalName()
Signature
public String getLocalName()
Return Value
Type: String
getRecordTypeInfos()
Signature
public List<Schema.RecordTypeInfo> getRecordTypeInfos()
Return Value
Type: List<Schema.RecordTypeInfo>
getRecordTypeInfosById()
Signature
public Schema.RecordTypeInfo getRecordTypeInfosById()
Return Value
Type: Map<ID, Schema.RecordTypeInfo>
getRecordTypeInfosByName()
Signature
public Schema.RecordTypeInfo getRecordTypeInfosByName()
Return Value
Type: Map<String, Schema.RecordTypeInfo>
getSobjectType()
Signature
public Schema.SObjectType getSobjectType()
Return Value
Type: Schema.SObjectType
isAccessible()
Signature
public Boolean isAccessible()
Return Value
Type: Boolean
isCreateable()
Signature
public Boolean isCreateable()
Return Value
Type: Boolean
isCustom()
Signature
public Boolean isCustom()
Return Value
Type: Boolean
isCustomSetting()
Signature
public Boolean isCustomSetting()
Return Value
Type: Boolean
isDeletable()
Signature
public Boolean isDeletable()
Return Value
Type: Boolean
isDeprecatedAndHidden()
Signature
public Boolean isDeprecatedAndHidden()
Return Value
Type: Boolean
isFeedEnabled()
Signature
public Boolean isFeedEnabled()
Return Value
Type: Boolean
isMergeable()
Signature
public Boolean isMergeable()
Return Value
Type: Boolean
isMruEnabled()
Signature
public Boolean isMruEnabled()
Return Value
Type: Boolean
isQueryable()
Signature
public Boolean isQueryable()
Return Value
Type: Boolean
isSearchable()
Signature
public Boolean isSearchable()
Return Value
Type: Boolean
isUndeletable()
Signature
public Boolean isUndeletable()
Return Value
Type: Boolean
isUpdateable()
Signature
public Boolean isUpdateable()
Return Value
Type: Boolean