1

...instead of staying on the detail view of the new child record as it's doing now. Is there a setting somewhere or would I be forced to override the New button and change the url to include saveURL=.

If I AM forced to override it then I may have heard a rumor that there's an easy way in VF to refer to the standard page view (or it's components) very, very succinctly. Can you point me toward that?

Thank you!

0

There are a variety of ways of doing what you're asking about. Which to do depends on whether you want to try and use url hacking. Most hacks have disappeared and definitely won't work with lightning pages. The alternative is to create a controller extension. In most cases, the essence of what you want to do is set redirect = true and direct the page you're linking to, to return to the record you're currently at by passing the current record's Id and redirecting the page to return to that recordId upon saving.

You can easily do that type of thing in a controller extension by passing the info to the extension, save the record, and return directly to your existing page; provided your extension has the functionality to save your record and generate the redirect PageReference. Here are links to two posts that describe how to do that: Create save button on custom visualforce page to redirect to parent record detail and Redirecting back to original page using visualforce. The latter post also has an answer showing how to do it using javascript.

I don't think using an override on your Save button is what you're looking for, but it may be. In the answer to this question: Override a standard "New" button to redirect to a VF page by @SFDCFox explains how to use the nooverride parameter with URLFOR to get back to a normal page. In your case, I believe you'd want to try using nooverride = false. I hope you find his post helpful and enlightening.

  • Thank you! This points me in the right direction. Thank you for it. – alan brown Apr 16 '16 at 23:04
  • @alanbrown You're very welcome. Community etiquette is to help others by marking your question as solved through checking the answer that resolved your issue. If you don't, it leaves the impression to anyone who searches the topic later that your question wasn't answered to your satisfaction. Once you have sufficient reputation, you can also upvote posts and answers. – crmprogdev Apr 17 '16 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.