I tried to write error handler to show errors near the fields that caused them. All works fine with every kind of Dml error except when required field is empty. How can I find field name from exception other then from getDmlFields method because it returns null in case of

error with StatusCode = REQUIRED_FIELD_MISSING?

  • Have you created a field in VF and trying to capture this DmlException.getDmlFields() in controller? – Saumya Ranjan Satapathy Feb 8 '17 at 10:46
  • No, it's lightning component in community, but it doesn't matter because DmlException.getMessage getting correct error message – user2452483 Feb 8 '17 at 11:02

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.