Record Changes
To perform more advanced tasks using force:recordData when the record changes, handle the recordUpdated event. You can handle record loaded, updated, and deleted changes, applying different actions to each change type.
If a component performs logic that’s specific to the record data, it must run that logic again when the record changes. A common example is a business process in which the actions that apply to a record change depending on the record’s values. For example, different actions apply to opportunities at different stages of the sales cycle.
Lightning Data Service notifies listeners about data changes only if the changed fields are the same as in the listener’s fields or layout.
The example shown here declares that your component handles the recordUpdated event. To improve performance, we recommend using the fields attribute to query only the fields you need. Use layoutType only if you want the administrator, not the component, to control the fields that are provisioned. The component must handle receiving every field that is assigned to the layout for the context user.
Implement an action handler that handles the change.
When loading a record in edit mode, the record isn’t automatically updated to prevent edits currently in progress from being overwritten. To update the record, use the reloadRecord method in the action handler.