function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TehNrdTehNrd 

How to redirect to Visualforce page after Contact save?

I have a Visualforce page related to an account with the requirement that the account must have at least one contact. In the page I have created a link that takes them to the creation of a new Contact. Upon save I would like to return the user back to the VF page.

 

Here is a very simple page to reproduce. Simply will in the accid parameter with any account Id.

 

<apex:page > <apex:outputLink value="{!URLFOR($Action.Contact.NewContact,null,[accid = '001Q0000003cgM4'])}">Click me!</apex:outputLink> </apex:page>

When redirected to the Create new contact page you will see the retURL parameter is populated correctly. If you hit cancel you will be returned to the page but if you hit save you will see the detail view for the contact. Is there any way to change this behavior. So type or retSave parameter?

 

Thanks,

Jason

 

Best Answer chosen by Admin (Salesforce Developers) 
XactiumBenXactiumBen

Try saveURL as a parameter.

All Answers

XactiumBenXactiumBen

Try saveURL as a parameter.

This was selected as the best answer
TehNrdTehNrd

Beautiful!

 

Thanks.