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

Pagereference in vf page
Hello All,
How to redirect to record edit page from visual force page and when i click cancel button in edit record(redirect to object record)it return back to visual force page my page had pagination.
For example am in 5th page one record edit it will redirect object record edit when i click on cancel
it will back to same 5th page. How to redirect?
Can any one explain?
Thanks
Hi varun,
here is the example to redirect page to account edit page.
For redirect to Navigation page
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thanks,
Hitesh Patel
SFDC Certified Developer & Administrator
All Answers
Hi varun,
here is the example to redirect page to account edit page.
For redirect to Navigation page
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thanks,
Hitesh Patel
SFDC Certified Developer & Administrator
PageReference pRef = ApexPages.StandardController(account).edit();
pReg.getParameters.put('retURL', ApexPages.currentPage().getURL());
return pRef;
}
You don't need to write cancel method explicitly. If you have retURL, standard controller's cancel method will take care of that.
You just need:
<apex:commandButton action="{!Cancel}" value="Cancel" />
Hi all,
Thanks for your quick reply. It will help to my requirement.
Thank you.