Activity Forums Salesforce® Discussions How To Display Error Message On Visualforce Page?

  • 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

  • Parul

    Member
    September 20, 2018 at 4:13 pm

    Hi

    Display Error message using :

    <apex:pageMessages />

    Thanks.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos