Right now, I am aware of the onerror
event of the recordForm tag. However, in the controller, event.getParam("errors")
doesn't return anything. This is how the controller code looks like:
handleRecordFormErrors : function(component, event, helper) {
var errorsArr = event.getParam("errors");
for (var i = 0; i < errorsArr.length; i++) {
console.log("error " + i + ": " + JSON.stringify(errorsArr[i]));
}
}
In the debug logs, a duplicate detection error gets logged, but the error in the frontend is always this: An error occurred while trying to update the record. Please try again.
, and event.getParams()
in the controller gives me nothing. How should I catch this error, or at least change the error message to something user friendly?
```
thing doesn't work; you need to use four spaces instead. In the future, consider using the{}
button to auto-format your code. – sfdcfox Jun 5 '18 at 5:02