function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sreenivas_cippyalisreenivas_cippyali 

how to display error msg on a page when a certain condition false

bob_buzzardbob_buzzard

Is this in a visualforce page or a standard page?

bob_buzzardbob_buzzard

There are a number of ways to do this.  One is to have a pagemessages component and then add an error message to it, something like:

 

<apex:page controller="MyController">
  <apex:pageMessages/>
    <apex:pageMessage summary="My Error Message" severity="error" strength="1" rendered="{!showError}/>
</apex:page>

 This assumes there is a boolean property in MyController named showError.