Activity Forums Salesforce® Discussions How to display error messages in Salesforce Visualforce Page?

  • shariq

    Member
    September 22, 2018 at 10:36 pm

    Apexpages.addMessage( new ApexPages.Message (ApexPages.Severity.ERROR, 'Required fields are missing. '));
    in Visualforce page add below tag where you want to display the error message.

    <apex:pageMessages ></apex:pageMessages>

  • Parul

    Member
    September 23, 2018 at 3:40 am

    Insert the below tag inside the visualforce page within page block

    <apex:pageMessages ></apex:pageMessages>

    Hope it helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos