Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
http://www.interactiveties.com/blog/2015/visualforce-apex-pagemessages.php http://www.sfdcpoint.com/salesforce/apexpagemessage-and-apexpagemessages-salesforce/
https://salesforce.stackexchange.com/questions/191078/displaying-an-error-message-on-a-visualforce-page?rq=1
1) Use apex:messages tag in Visualforce Page
2) Use Try catch block in Visualforce Controller and use ApexPageMessages.addMessage (Exception) in the catch block.
Hope it helps, if it does mark it as solved.
Thanks
Greetings to you!
- I read your problem and implemented in my Org.
- Please use the below code [Solved] : -
try{
// Your code here
} catch(Exception ex){
Apexpages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.FATAL, 'No such combination exists'));
}
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
You can use <apex:pageMessages> for Error Handling in Visualforce.
Here is the link for that: And here is the same problem as your's: I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi