You need to sign in to do that
Don't have an account?
vinayakamurthy
Error messages
how can i get an visualforce error messages in a variable and can store that???
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
how can i get an visualforce error messages in a variable and can store that???
ApexPages.hasMessages() to find if any errors exist on the page AND
ApexPages.Message[] apxMsg = ApexPages.getMessages();
You can check Like the following
ApexPages.getMessages();
You can also get the exeptions through try-catch.
If you want to add new message through controller then like the following
Controller
public String pageMsg{get;set;}
pageMsg = 'Please select at least one field for Assignment.';
ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.ERROR,pageMsg));
Page
<apex:outputPanel rendered="{!pageMsg != NULL}">
<apex:pagemessages />
</apex:outputPanel>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks