I just refreshed my dev sandbox and my staging sandbox. In my dev, lightning data service is able to load the record. When I go into my staging environment, which is a partial copy sandbox, no record will load, I will get the ERRROR
changeType in my handlePrescription
.
Component
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" controller="CallerAppController">
<aura:attribute name="prescription" type="Case" />
<force:recordData aura:id="prescriptionEditor"
recordId="{!v.recordId}"
targetFields="{!v.prescription}"
fields="Id,CaseNumber"
mode="EDIT"
recordUpdated="{!c.handlePrescription}" />
</aura:component>
Controller.js
handlePrescription: function(component, event, helper) {
console.log(component.get("v.recordId")); // returns an id
let prescription = component.get("v.prescription");
let eventParams = event.getParams();
console.log(eventParams.changeType);
if(eventParams.changeType === "ERROR") {
//helper.reload(component);
} else if(eventParams.changeType === "LOADED") {
//console.log("Prescription has loaded successfully.");
//console.log(JSON.parse(JSON.stringify(prescription)));
} else if(eventParams.changeType === "CHANGED") {
} else if(eventParams.changeType === "REMOVED") {
// record is deleted
//console.log("Record was removed.");
}
},
How can I debug this?