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
MVJMVJ 

Redirct back to parent object

I have created a custom object that hangs off of the case object.

When the user creates a new record on the custom reltaed list and hits save it leaves them on the newly created record
nsted of redirecting them back to the case.

The user can always click the link to the case but that is an extra step and not the same functionality that exists with other
related lists.

I would like this to work the same as creating a new task for the case.  Afetr you save the new task it takes you back to the
case instead of leaving you on the newly created task.

Any ideas on how I can do this?
werewolfwerewolf
Override the New button and make it exactly the same as the URL but with a different saveURL parameter.

For example, currently when you press the New button off the Case related list it probably looks something like this:

https://na1.salesforce.com/a02/e?CF00N30000001cYtG=00012103&CF00N30000001cYtG_lkid=500300000039tKo&retURL=%2F500300000039tKo

You would therefore want to make your custom button do something like this:

https://na1.salesforce.com/a02/e?CF00N30000001cYtG={!Case.CaseNumber}&CF00N30000001cYtG_lkid={!Case.Id}&retURL=%2F{!Case.Id}&saveURL=%2F{!Case.Id}

The things you'll need to change here to match the actual bits in your original URL are in bold.


MVJMVJ
I created a custom S-Control that looks like this:

/a06/e?CF00NT0000000xJDG={!Case.CaseNumber}&CF00NT0000000xJDG_lkid={!Case.Id}&retURL=%2F{!Case.Id}&saveURL=%2F{!Case.Id}

I then Went to the custom object and overrode the New Buttoin and poinyted it to the S-Control noted above.

When you click the new button the following URL is generated:

https://tapp0.salesforce.com/a06/e?CF00NT0000000xJDG=00059114&CF00NT0000000xJDG_lkid=500T0000001W312&scontrolCaching=1&retURL=%2F500T0000001W312

And the page never displays it just hangs.  What is the scontrolCaching=1 mean?  What happened to the saveURL Parameter.

If I manually enter the URL into the address toolbar it works fine.  But the S-Control overriding the New button is acting funny.  Did I miss something?

werewolfwerewolf
You'll want to add a &nooverride=1 in there.  The problem is that you're entering an infinite loop of overriding, so you have to tell it "don't override this URL."
MVJMVJ

Ok that made the page display.  However it dropped the saveURL parameter and did not maintainthe relationship to the case that I started on.

Any other thoughts?

werewolfwerewolf
Try putting it in a custom New button instead of overriding the existing New button.
MVJMVJ
That did it.  Thanks for all your Help.
wickwick
I have a custom object (A) hanging off another custom object (B).
I created a custom "New" button that creates a new Custom object B and pulls in some data from object A into some fields of object B.
My problem is that when I click Save, I want to go to the newly created object B instead of back to the master object A. What do I put in the &saveurl parameter to send the user to the newly created custom object B page?

MVJMVJ
It has been a while since I looked at this but if you want to stay on the newley created element do not use the Saveurl option.
wickwick
So simple. Of course I tried everything else but that.
Thanks for your help.
LalitLalit

Please let me know if this will work with S-control, I tried writing everything in S-control and scree just hangs.

I need to call different URL based on the Record Type Selection,

After save on Object A, I need to dynamically default some of the value to the new URL object (Say Child Object B, this get opened after Save on object A)

 

Appreicate any input or insight