You need to sign in to do that
Don't have an account?

Display trigger error message in visualforce page
Hi,
I am having an issue with displaying trigger error on a Visualforce page. In my trigger, I'm having the following piece of code to throw the error:
Again, on my VF page, I have added the following snippet:
VF_PAGE_MESSAGE|You are not allowed to do this...
Anyone has any idea about it?
Thanks..
I am having an issue with displaying trigger error on a Visualforce page. In my trigger, I'm having the following piece of code to throw the error:
myCustomObjectInstance.addError('You are not allowed to do this...');
Again, on my VF page, I have added the following snippet:
<apex:pagemessages/>The problem is that when I simulate the error condition, it does not display the error message on the VF page, but the same is visible in debug log as follows:
VF_PAGE_MESSAGE|You are not allowed to do this...
Anyone has any idea about it?
Thanks..
It was a bad mistake i believe. Thanks again to everyone for their time.
All Answers
Here is the code snippet
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'ADD YOUR MESSAGE HERE.');
ApexPages.addMessage(myMsg);
It was a bad mistake i believe. Thanks again to everyone for their time.