Functions available for CRUD records

The Lightning Data Service component force:recordData provides utility functions to create a new record, save an existing record, delete a record, and detect changes on a Salesforce object. This makes it very easy to build the components used on Salesforce record pages.

Let's suppose that we have a Lightning component with an aura:id attribute, illustrated as recordComponent in the following code:

<force:recordData aura:id="recordComponent"      recordId="{!v.recordId}"      layoutType="FULL"      targetRecord="{!v.record}"      targetFields="{!v.simpleRecord}"      targetError="{!v.recordError}"      recordUpdated="{!c.handleRecordUpdated}"      mode = "VIEW"      />

The following section will describe code snippets for various operations that ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.