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 data to help handle the error, such as the field or page-level errors.

An error is undefined if the save state is SUCCESS or DRAFT.

recordId String The 18-character ID of the record affected.
state String The result state of the operation. Possible values are:
  • SUCCESS: The operation completed on the server successfully.
  • DRAFT: The server wasn't reachable, so the operation was saved locally, as a draft. The change is applied to the server when it's reachable.
  • INCOMPLETE: The server wasn't reachable, and the device doesn't support drafts. (Drafts are supported only in the Salesforce app.) Try this operation again later.
  • ERROR: The operation couldn't be completed. Check the error attribute for more information.
Lightning Data Service does not support all of the objects, and a comprehensive list of considerations and limitations can be found in the official documents at https://developer.Salesforce.com/docs/atlas.en-us.Lightning.meta/Lightning/data_service_considerations.htm.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.235.79