You need to sign in to do that
Don't have an account?
Anusha Vankayalapati
ApexPages.addMessage can only be called from a Visualforce page ()
Hi Team,
I have received the below exception mail from my org. Can anyone please let me know why this error is thrown.
execution of AfterUpdate caused by: System.FinalException: ApexPages.addMessage can only be called from a Visualforce page ()
I have received the below exception mail from my org. Can anyone please let me know why this error is thrown.
execution of AfterUpdate caused by: System.FinalException: ApexPages.addMessage can only be called from a Visualforce page ()
It seems Trigger and VF page both are using same apex class and in apex class ApexPages.addMessage is used for vf page message which will not work for trigger.
Quick Solution would be add this ApexPages.addMessage in try catch.
Thanks
Hemant
Thanks for your response. But I am sure that this is not used in VF page. This ' ApexPages.addMessage ' is used in an apex class which is used from trigger. ApexPages.addMessage is kept in try catch block. Please let me know why this exceprion is thrown.
Thanks-in-advance.