You need to sign in to do that
Don't have an account?
Ian Goodine
Class to open another visualforce page from an action button
I have a visualforce page (NCR View) embedded on an object layout (Non Conformance). The visual force displays the relevant fields in detail view. I made another VF page (NCR Edit) that shows the same fields in edit view.
I've created an "Edit" button on NCR View that is meant to redirect me to the NCR Edit page by calling the method OpenPage. I will eventually create a save button on the NCR Edit that saves the info and brinds you back to NCR View.
When I click the edit button it redirects me to the new page but that page doesn't seem to really be associated to the fields in the object at all. Ideas?
My extension class:
public PageReference OpenPage() {
PageReference pr = new PageReference('/apex/Material_Nonconformity_Report');
pr.setRedirect(true);
return pr;
}
Call to the method in NCR View:
<apex:commandButton value="Edit" action="{!OpenPage}"/>
I've created an "Edit" button on NCR View that is meant to redirect me to the NCR Edit page by calling the method OpenPage. I will eventually create a save button on the NCR Edit that saves the info and brinds you back to NCR View.
When I click the edit button it redirects me to the new page but that page doesn't seem to really be associated to the fields in the object at all. Ideas?
My extension class:
public PageReference OpenPage() {
PageReference pr = new PageReference('/apex/Material_Nonconformity_Report');
pr.setRedirect(true);
return pr;
}
Call to the method in NCR View:
<apex:commandButton value="Edit" action="{!OpenPage}"/>
Use bellow code for open another visualforce page from an action button it may helpful for you.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com