<force:recordData aura:id="forceRecord" recordId="{!v.recordId}" layoutType="FULL" targetRecord="{!v._record}" targetFields="{!v.simpleRecord}" targetError="{!v._error}" recordUpdated="{!c.recordUpdated}" />
({ recordUpdated: function(component, event, helper) { var changeType = event.getParams().changeType; if (changeType === "ERROR") { /* handle error; do this first! */ } else if (changeType === "LOADED") { /* handle record load */ } else if (changeType === "REMOVED") { /* handle record removal */ } else if (changeType === "CHANGED") { /* handle record change */ } })
If the record becomes inaccessible on the server, the recordUpdated event is fired with changeType set to "REMOVED." No error is set on targetError, since records becoming inaccessible is sometimes the expected outcome of an operation. For example, after lead convert the lead record becomes inaccessible.
When the record becomes inaccessible on the server, the record’s JavaScript object assigned to targetRecord is unchanged.