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

<apex:pagemessages> not working in visualforce page.
<apex:pagemessages> not working in visualforce page.
Error with details directly redirected to new page
I want to show errormesage in standard error messagebox.
Below is the code details.
If the logedin user doesn't have FLS access then error message should get display on same page.
Visualforce Page:
Controller Code:
Error with details directly redirected to new page
I want to show errormesage in standard error messagebox.
Below is the code details.
If the logedin user doesn't have FLS access then error message should get display on same page.
Visualforce Page:
<apex:pageMessages id="pmsg" /> <apex:pageBlock title="Cases"> <apex:pageBlockButtons > <apex:commandButton value="Select " onclick="return Test();" action="{!caseMethod}" reRender="pmsg" /> </apex:pageBlockButtons>
Controller Code:
if (!CaseComment.sObjectType.getDescribe().isDeletable()){ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,'Insufficient access')); return null; } delete ChildComment;
Remove that part and try it.
OR
If there is a validation part or somthing in the Test() function, then use the following way.
If you get the answer, please mark it as the correct answer. It will be a help to others who are facing the same problem later.
I have tried using above code but unfortunately its not working.
My controller method (caseMehtod()) not getting called from javascript by using above code.
When i am putting reRender ="pmsg" in commandbutton its giving null value error in javascript code at (shid.value = store;) line but when i am removing that , page is reRendering but caseMethod() not getting called.
Below is the javascript code.
Controller Method:
The script may be throwing an error in getting or setting the value of an element.
Regards,
Krishna.