function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hikiran rajuhikiran raju 

how to show the validation error message in custom VF page

Hi everyone,
I have created an custom VF page with  std.object and Custom object fields. In that i have an submit button, when submit button is clicked i need to show the error messages for the fields which are mandatory if they are empty and null. How can i show the validation error message in my custom vf page. Can any one help me over here.
Thanks in advance.

Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you

Visualforce page:
<apex:pageMessages />

Apex Controller:
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Error Message.');


ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Error Message.'));