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
Anu Raj.ax1269Anu Raj.ax1269 

error message

Hi 

  I am not able to dispaly  error message on VF page 

  My code : 

VF page 

<apex:page contr

<apex:pageMessages />

 

controller 

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

 

can anybody help me to solve this problem.

 

Thanks

Anu

Navatar_DbSupNavatar_DbSup

Hi,

Try the below code snippet as reference:

<apex:page controller="examples1" >

  <apex:pageMessages />

</apex:page>

 

..............................

Controller

..............................

 

public class examples1 {

 

public examples1()

{

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

}

 

}

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

chirugantachiruganta

<apex:messages title="Errors Occured" styleClass="errorMsg" style="font-family:georgia,garamond,serif;" />

Anu Raj.ax1269Anu Raj.ax1269

Hi Navatar_DbSup ,

 

Same think i have tryed and no result is coming?