1

I have recordEditForm in my component to create a new record. On submit of the form, the page lightning message shows "An error occurred while trying to update the record. Please try again." Then I used lightning inspector to check the exact cause of the issue. This is what I found, enter image description here

There are some validation issues like the above one. How do we display this exact error messages on the page itself so that user will know what needs to be done to submit the form successfully.

Am using onerror of recordEditForm like below,

handleError : function(component, event, helper) {
    var eventName = event.getName();
    var eventDetails = event.getParam("error");
    alert('Error Event received' + eventName);
},

But it is just diplaying "error" in the alert.

Any help is appreciable. Thanks!.

  • Here you have to write some logic into JS to handle it. Like Salesforce returns a different object for the different type of errors. LIke in this API call you will get the error details from the output object. – itzmukeshy7 Aug 4 '18 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.