Skip to navigation

Entity

View as Markdown
global with sharing class Entity
Description
Represents a Salesforce object.
id
@AuraEnabled global Id id
The Salesforce object ID.
isValid
@AuraEnabled global Boolean isValid
Whether the entity is valid or not. It is considered valid if the ID is defined.
label
@AuraEnabled global String label
The localized Salesforce object label.
name
@AuraEnabled global String name
The Salesforce object name.
parent
@AuraEnabled global Entity parent
The Salesforce object parent (e.g. Account for Opportunity).
typeName
@AuraEnabled global String typeName
The name of the Salesforce object type.

Methods

global Entity(final Id id)
Description
Constructs an entity. This will populate the type and label via SObject describe.
Parameters
id
final Id id
The Salesforce object ID.
global Entity(final Id id, final String name, final Entity parent)
Description
Constructs an entity. This will populate the type and label via SObject describe.
Parameters
id
final Id id
The Salesforce object ID.
name
final String name
The Salesforce object name.
parent
final Entity parent
The Salesforce object parent.
global static Entity resolve(final Id id)
Description
Resolves an entity by type and ID. This operation may involve one or more SOQL queries.
Returns
The resolved entity or null if it cannot be resolved.
Parameters
id
final Id id
The Salesforce object ID.