Since Summer '17 Lightning Data Service allows to load record by means of only markup of component
In a nutshell, Lightning Data Service provides reusable Aura
components that:
- Minimize XMLHttpRequests (XHRs)
- Fetch records once,
reducing network transfers, app server load, and database server load
- Cache record data on the client, separate from component metadata
- Share record data across components
- Enable progressive record loading, caching, and merging more fields and layouts into the cache
- Enable proactive cache population
- Promote consistency by using only one instance of the record data across multiple components
- Create notifications when record data changes
If you have a Lightning application that creates, reads, updates, or deletes records, LDS is the best, most efficient way to do CRUD operations.
Example of usage:
<force:recordData aura:id="forceRecordCmp"
<!-- aura:id is required to reference the component in your Javascript controller -->
recordId="{!v.recordId}"
layoutType="{!v.layout}"
fields="{!v.fieldsToQuery}"
mode="VIEW"
targetRecord="{!v.record}"
targetFields="{!v.simpleRecord}"
targetError="{!v.error}"
/>