Any guidance would be extremely helpful!! Thank- Amber
1 risposta
Case 1
if you're visual force page is doing a DML, then you could put this tag on the top of vf , below the apex:page
<apex:pageMessages id="errorMessage"/>
then you can write a validation rule on the object with your criteria.
Case 2
your VF has some logic that which evaluates to a an error ... and you need to display a message
in your controller
public void myMethod()
{
// you're doing your logic
...
if(somehing happens )
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,
'Some very important message for the user'));
}}
if our suggestion(s) worked, let us know by marking the answer as "Best Answer" right under the comment.This will help the rest of the community should they have a similar issue in the future. Thank you!
Shiv