Activity › Forums › Salesforce® Discussions › How To Display Error Message On Visualforce Page? Salesforce® Discussions How To Display Error Message On Visualforce Page? Posted by Aman on September 20, 2018 at 3:11 PM How To Display Error Message On Visualforce Page? Parul replied 7 years, 9 months ago 3 Members · 2 Replies 2 Replies shariq Member September 20, 2018 at 3:14 PM Hi, In the Visualforce page add the tag: <apex:pageMessages /> In the controller class add the error message where required if ( requiredFieldName == null){ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, ‘Please enter a value in the Required Field’)); } Thanks [adinserter block='9'] Parul Member September 20, 2018 at 4:13 PM Hi Display Error message using : <apex:pageMessages /> Thanks. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me