You need to sign in to do that
Don't have an account?
Save & New
Hi,
I want to replicate the Save & New button futionality in my vf page. See my comments in the code.
public with sharing class SaveNew {
private ApexPages.StandardController solnController;
private final EP_Action__c action;
public SaveNew(ApexPages.StandardController controller) {
solnController = Controller;
action = (EP_Action__c)controller.getRecord();
}
public PageReference savenew()
{
solnController.save();
PageReference page = new pagereference('/a0J/e');----> I dont want this hard coded. any alternative way?
page.setRedirect(true);
return page;
}
}
You should be able to reference the edit page from the standard controller.
Thanks for reply,
however i dont want the edit page, i want to redirect to New page.
So you do! I just saw the /e in the URL and assumed that you wanted the edit! Sorry about that - I should read posts more carefully.
There doesn't seem to be a simple way to access this, as the controllers don't expose it. The $Action global variable has a new property that you can use on a page:
so you could probably create something that sends this back to the controller from the page, but its less than elegant.