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
Vijaya Kumar RegantiVijaya Kumar Reganti 

How to remove the error message from the top of the VF page???

I have a VF page with <apex:messages/>,a field which has a validation rule and  ApexPages.AddMessage() method in the class.

The validation written for field is to display an error message at the field.but it is displaying the error message at the top of the page also.

So How can I remove the Top message with out removing the <apex:messages/> tag.

Best Answer chosen by Admin (Salesforce Developers) 
Vijaya Kumar RegantiVijaya Kumar Reganti
Hi,
I got my solution for this. Instead of using a validation rule I have used the code to display a validation error and rendered an output label to display the error message....

All Answers

Bhawani SharmaBhawani Sharma
If you refresh the complete page, it won't be possible.
1. Rerender the only section where your field is present.
2. Use pageMessage tag and message in it dynamically.
Vijaya Kumar RegantiVijaya Kumar Reganti

Hi Bhavani,

 

Thanks for the reply.

 

but this field also exists in the same section where the other fields are there.This field has to be there in that section.

 

Is there any ??

Vijaya Kumar RegantiVijaya Kumar Reganti
Hi,
I got my solution for this. Instead of using a validation rule I have used the code to display a validation error and rendered an output label to display the error message....
This was selected as the best answer