You need to sign in to do that
Don't have an account?
anu123
How to write custom error message in VF page
Hi all,
i need to write custom error message for unique field not allowing duplicates in vf page. can u give me the sample code.
Thanks in advance
anu
Use the following code in the controller class.
catch(Exception e)
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Error'));
}
Also add this tag in the vf page.
Thanks,
Malar
All Answers
Use the following code in the controller class.
catch(Exception e)
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Error'));
}
Also add this tag in the vf page.
Thanks,
Malar
Thank u for ur reply. thanks a lot