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

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


Is this in a visualforce page or a standard page?


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:pageMessage summary="My Error Message" severity="error" strength="1" rendered="{!showError}/>

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