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
rzsrzs 

Showing Errors using Apex Code

Hello,

 

We can assign an error to a field, but is it possible to show the error on the top of the page using Apex code ?

 

Please Help

Thank You

Best Answer chosen by Admin (Salesforce Developers) 
snievassnievas

I think what you're asking for is:

 

<apex:messages />

You can use this at the top of your VF page.

All Answers

snievassnievas

I think what you're asking for is:

 

<apex:messages />

You can use this at the top of your VF page.

This was selected as the best answer
rzsrzs

Thanks snievas :)

cherrysbluecherrysblue
HI, I want to change my error message color to red :  for example: when the error this played it will appear like : error:xxxxxxxxxxxxxxxx
right now, error is red but the xxxx is black. I used the code <apex:messages style="color:red;"/>, it repeated the message again in red but the xxx part is stil black.