Considerations and Limitations

Lightning Data Service is powerful and simple to use. However, it’s not a complete replacement for writing your own data access code. Here are some considerations to keep in mind when using it.
Note

Note

Lightning Data Service is available as a beta. Lightning Data Service isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements.

Lightning Data Service is only available in Lightning Experience and Salesforce1. Using Lightning Data Service in other containers, such as Lightning Components for Visualforce, Lightning Out, or Communities isn’t supported. This is true even if these containers are accessed inside Lightning Experience or Salesforce1, for example, a Visualforce page added to Lightning Experience.

Lightning Data Service supports primitive DML operations—create, read, update, and delete (or CRUD). It operates on one record at a time, which you retrieve or modify using the record ID. Lightning Data Service supports spanned fields with a maximum depth of five levels. Support for working with collections of records or for querying for a record by anything other than the record ID isn’t available. If you must support higher-level operations or multiple operations in one transaction, use standard @AuraEnabled Apex methods.

Lightning Data Service shared data storage provides notifications to all components that use a record whenever a component changes that record. It doesn’t notify components if that record is changed on the server, for example, if someone else modifies it. Records changed on the server aren’t updated locally until they’re reloaded. Lightning Data Service notifies listeners about data changes only if the changed fields are the same as in the listener’s fields or layout.

Lightning Data Service supports the following entities.
  • Account
  • AccountTeamMember
  • Asset
  • AssetRelationship
  • AssignedResource
  • AttachedContentNote
  • Campaign
  • CampaignMember
  • Contact
  • ContentWorkspace
  • Contract
  • ContractContactRole
  • CustomObjects
  • Entitlement
  • EnvironmentHubMember
  • LicensingRequest
  • MaintenanceAsset
  • MaintenancePlan
  • MarketingAction
  • MarketingResource
  • OperatingHours
  • ProcessInstanceHistory
  • Quote
  • ResourceAbsence
  • ServiceAppointment
  • ServiceResource
  • ServiceResourceSkill
  • ServiceTerritory
  • ServiceTerritoryMember
  • ServiceTerritoryLocation
  • SkillRequirement
  • SocialPost
  • Tenant
  • TimeSheet
  • TimeSheetEntry
  • TimeSlotShipment
  • UsageEntitlement
  • UsageEntitlementPeriod
  • WorkOrder
  • WorkOrderLineItem
  • WorkType