You need to sign in to do that
Don't have an account?
Proposal Button
trying to display warning message Error: Compile Error: unexpected token: ')'
Hi All
I am trying to display a warning message in the custom VF page. Here is the thing i mentioned in the controller
ApexPages.Message errMsg = new ApexPages.Message(ApexPages.Severity.FATAL, sendtomagnys.getMessage());
ApexPages.addMessage(errMsg);
This is the error it is throwing
Error: Compile Error: unexpected token: ')'
Can you please help me out why it is throwing me the error. I mentioned this in middle of my apex controller....
1. Write the line given below in the VF page :
<apex:messages />
2. Write the lines given below in the controller :
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.severity, summary); // For Standard error message
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'my error msg'); // For Custom error message
ApexPages.addMessage(msg);
Hope this helps.