We have a unique field that blocks multiple records for being submitted for the same date. How do I customize this error message? Here is the section of my code grabbing the exception:
public PageReference saveRecord(){
try {insert fc;}
catch(DMLException e){
system.debug(e);
ApexPages.addMessages(e);
return null;
}
I simply have a tag for messages at the top of my VF page:
<font color = 'red'>
<apex:messages id="errorMsg" />
</font>