You need to sign in to do that
Don't have an account?
Carlton Brumbelow
How do I have a custom visualforce button redirect to a standard 'New' page? (problem: getting the right URL)
My problem is very specific. I know how to make a button redirect. Here's my setup and the problem
Setup:
Setup:
- Custom visualforce page with an apex:commandButton that calls an action in my controller.
- Controller has the appropriate PageReference method. This works, when I have a redirect URL I can get to
- In my custom object the 'New' button is overridden to navigate to my custom visualforce page
- I want the button on my visualforce page to then redirect to what would normally be the standard page for the 'New' button (when not overrideen), but I cannot find right URL for that page. When I switch the standard action back to the standard page and grabe the URL, it does not work in my code.
All Answers
Refer below code,
public pageReference redirectToOriginal(){
pageReference pg = new pageReference('/a01/e');
return pg;
}
Here a01 are the first 3 digits of the ID of record of my object.