0

I have a parent object, which is linked to a junction object. In the related list, I can create a new junction object, and when I click save on the junction object, it then displays the details of the junction object. I would like to redirect the user to the parent object though. Is this possible somehow? Tia.

3

The trick is to set the saveUrl or the retUrl to the Id of the object you want the user to return.

  1. Is there a saveURL URL parameter set? If so, redirect to that.
  2. Is there a retURL URL parameter set? If so, redirect to that.
  3. Redirect to /home/home.jsp

You have some options, the first one would be to override the New button just like this post illustrates.

The other option is to create a controller extension and have this type of code.

public pagereference redirectUrl(){
    pagereference pf= new pagereference('/'+parent.id);
return pf;

<apex:commandbutton value="Save" action="{!redirectUrl}"/>
|improve this answer|||||

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.