I am building a lightning component that needs to allow a series of fields on Case to updated by a community user. This component loads up just fine in Lightning Experience, and even in the Community Builder preview. But when I login to the community as an actual user I see this error: **
Cannot Read Property 'ErrorCode' Of Undefined
** I realize this is likely a record permission or a field accessibility issue, but I have checked and the community profile has visibility and edit permissions to the field. As well as Read/Create/Update on the Case object. Interestingly however, if I load up the case detail standard page layout in community the field is editable. So this seems to be isolated to the lightning:recordEditForm component. Any ideas how to solve for this?
<aura:component implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes,force:hasRecordId" >
<aura:attribute name="recordId" type="String"/>
<lightning:recordEditForm recordId="{!v.recordId}" objectApiName="Case" onerror="{!c.getError}" onload="{!c.onLoad}">
<lightning:messages />
<lightning:inputField fieldName="Description" />
<lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" />
</lightning:recordEditForm>
getError : function(component, event, helper){
debugger;
var errorObj = event.getParams();
var errorString = JSON.stringify(errorObj);
console.log("@@@@: " + errorString);
}
EDIT*** Some additional information, looks like ErrorCode is a paramater returned by the onerror event object. Strinigfy spits out the whole error:
{"message":"Cannot read property 'errorCode' of undefined","detail":"","output":{},"error":{"type":"TRANSPORT_ERROR","details":{}}}