Using SaveRecordResult 

You will have noticed that the saveRecord and deleteRecord functions of Lightning Data Service return a SaveRecordResult object in the callback. The SaveRecordResult object has information related to the context ID of the record and the error details. The following table describes the various properties available in the SaveRecordResult object:

Attribute Name Type Description
objectApiName String The object API name for the record.
entityLabel String The label for the name of the sObject of the record.
error String

The error can be one of the following:

  • A localized message indicating what went wrong.
  • An array of errors, including a localized message indicating what went wrong. It might also include further ...

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.