I have added some custom checks using Configuration for the object. I am inserting this object record through the visualforce page. I added <apex:pageMessages/>visualforce to my page. I also wrote a code block in order to catch the exception and show the OB v error message. Please find the code below:
catch(DMLException excp)
{
ApexPages.Message msg = new ApexPages.Message(Apexpages.Severity.ERROR, excp.getMessage() );
ApexPages.addMessage(msg);
return null;
}
However, I cannot only get the error message from user check. It shows me an error as shown below:
Paste failed. The first exception on line 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, error_message_from_custom_validation_comes_here
Is there any solution for this?