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
Chamil MadusankaChamil Madusanka 

Custom URL for retURL parameter

Hi All,

 

Can we use our own URL for retURL parameter? I tried to use one of my page's URL. But It is not working. Is there any specific way to use such URL in retURL parameter?

 

Following example URL is of  enter New Employee (Employee__c object)

 

 

https://ap1.salesforce.com/a07/e?retURL=%2Fa07%2Fo

custom page URL

 

 

https://c.ap1.visual.force.com/apex/InlineContact

 

Thanks in Advance

--

Chamil Madusanka

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
pierreeymard@saaspointpierreeymard@saaspoint

There is a solution: use saveURL , as in 

...&saveURL=%2F{!whateverID}

 

 

Pierre Eymard

pierre.eymard@saaspoint.com

Saaspoint

London, UK

All Answers

kiranmutturukiranmutturu

from where you want to return to your custom page?if it is apex you use pagereference.. if it is u can do this by javascript also....

Chamil MadusankaChamil Madusanka

Hi,

 

I going to use in markup.

Like

 

 <apex:outputLink value="/a0A/e?retURL=%2Fa0A%2Fo&parent={!node.id}&CF00N90000001xlOl={!node.name}" target="_blank">Add</apex:outputLink>

 I want to use custom page in retURL. How to do that?

 

--

Chamil Madusanka

 

sfdcfoxsfdcfox

retURL is completely ignored for new record pages. That's probably why you are having a problem getting it to work.

Kirill_YunussovKirill_Yunussov

is there a solution to this?  How can we override this and have the user return to the original page?

 

Example: I have a VF page where a user can click different links, create different new objects of different types, then go back to the original VF page.

sfdcfoxsfdcfox

The solution is... there is no solution. The functionality is hardcoded into the platform. If you want to use your own retURL, you'd have to create a custom new record page (Visualforce) to override the behavior.

pierreeymard@saaspointpierreeymard@saaspoint

There is a solution: use saveURL , as in 

...&saveURL=%2F{!whateverID}

 

 

Pierre Eymard

pierre.eymard@saaspoint.com

Saaspoint

London, UK

This was selected as the best answer
ScottBrown5000ScottBrown5000

Pierre, you are the man! Thank you! I hope everyone scrolls past SFDCFox's incorrect reply that there is no solution, and the author marks your answer as the correct one. 

sfdcfoxsfdcfox

Scott,

 

No need to be so harsh. After all, I can't know everything about sfdc (nor do I claim to). Since Pierre is indeed correct, I've updated the solution accordingly. Well done, Pierre.

SFDC coderSFDC coder
hi all,
may i know how can i extend this code to get back to the VF  where i had come from?
<apex:commandbutton action="{!URLFOR($Action.DisplayCheck__c.New,null,[CF00N20000009H4jV=vname,CF00N20000009H4jV_lkid=vname],true)}" />