Welcome to my blog

I have been working with Salesforce for quite a while, so don’t hesitate to contact me if you have any questions or want some advice.

s f

Subscribe
Follow Us
h

How to Display Error/Information messages in Visualforce Pages

 . Apex  . How to Display Error/Information messages in Visualforce Pages

How to Display Error/Information messages in Visualforce Pages

Learn How to Show Error/Information Message in Visualforce Page

Many case user want to display multiple error/warning/information message in the UI(Visualforce Page). Please find below sample code

Apex Code :

ApexPages.addmessage(new ApexPages.message(ApexPages.Severity.Info, 'Please fill all manfaroty fields.'));
ApexPages.addmessage(new ApexPages.message(ApexPages.Severity.Error, 'Name is manfatory.'));
ApexPages.addmessage(new ApexPages.message(ApexPages.Severity.WARNING, 'Need more information in order to process your file.'));

Visualforce Page:

<apex:pageMessages>

Note : you can use this logic for debugging code also

Post a Comment