Newer Version Available
Considerations
- Lightning Experience
- Salesforce app
- Lightning Communities
- Lightning Out
- Lightning Components for Visualforce
- Standalone Lightning apps
- Lightning for Gmail
- Lightning for Outlook
Lightning Data Service supports primitive DML operations—create, read, update, and delete. 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.
Supported Objects
Lightning Data Service supports custom objects and the following.
- Account
- AccountContactRelation
- AccountPartner
- AccountTeamMember
- ActionCadence
- Asset
- AssetRelationship
- AssignedResource
- AttachedContentNote
- BusinessAccount
- Campaign
- CampaignMember
- CareBarrier
- CareBarrierType
- Case
- Contact
- ContactRequest
- ContentDocument
- ContentNote
- ContentVersion
- ContentWorkspace
- Contract
- ContractContactRole
- ContractLineItem
- Custom Object
- Entitlement
- EntityArchivingSetup
- EnvironmentHubMember
- Image
- Lead
- LicensingRequest
- MaintenanceAsset
- MaintenancePlan
- MarketingAction
- MarketingResource
- Note
- OperatingHours
- Opportunity
- OpportunityLineItem
- OpportunityPartner
- OpportunityTeamMember
- Order
- OrderItem
- OrderSummary
- Partner
- PersonAccount
- Pricebook2
- PricebookEntry
- Product2
- Quote
- QuoteDocument
- QuoteLineItem
- RecordType
- ResourceAbsence
- ResourcePreference
- RetailVisitKpi
- RetailVisitWorkTask
- ServiceAppointment
- ServiceContract
- ServiceCrew
- ServiceCrewMember
- ServiceResource
- ServiceResourceCapacity
- ServiceResourceSkill
- ServiceTerritory
- ServiceTerritoryLocation
- ServiceTerritoryMember
- Shift
- Shipment
- SkillRequirement
- SocialPost
- SurveyInvitation
- SurveyResponse
- SurveySubject
- Tenant
- TimeSheet
- TimeSheetEntry
- TimeSlot
- UsageEntitlement
- UsageEntitlementPeriod
- User
- Visit
- WorkOrder
- WorkOrderLineItem
- WorkType