Posts

Showing posts from May, 2017

Show error message in Visualforce Page

Source: sfdcpoint.com Show error message in Visualforce Page using ApexPages.addmessage Sometime we need to show error message on Visualforce page. We can implement this requirement by creating new instance of ApexPages.message and then adding message to Apexpages using ApexPages.addmessage. Then displaying these messages in visualforce page. We can add 5 different types of message in Visualforce Page. In the example below, we are showing 5 input fields of account. We have added a button on visualforce page. Different type of message will be shown on visualforce page if we will keep any field blank. Click for Demo Visualforce Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 < apex:page standardController = "Account" extensions = "ErrorMessageInVfController" >   < apex:form >     < apex:pageblock >        < apex:pageMessages id = "showmsg" ></ apex:pageMessag...