I am getting only the below generic error message in lightning:recordForm
component.
An error occurred while trying to update the record. Please try again.
But I see the below error in the onerror
event parameter.
"message":"An error occurred while trying to update the record. Please try again.","detail":"","output":{"errors":[],"fieldErrors":{"Name":[{"constituentField":"LastName","duplicateRecordError":null,"errorCode":"REQUIRED_FIELD_MISSING","field":"Name","fieldLabel":"Last Name","message":"Required fields are missing: [LastName]"}]}}
<lightning:recordForm objectApiName="{!v.objectName}" aura:id="recordForm"
fields="{!v.fields}"
mode="readonly" columns = "{!v.columns}" recordId="{!v.recordId}" onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" oncancel="{!c.handleCancel}" onerror="{!c.handleError}">
<lightning:messages />
</lightning:recordForm>
mode
in there isreadonly
where you cannot edit a record.