+ Start a Discussion
VintaraVintara 

!save action and retURL help required.

So I have an APEX page that uses a sandardcontroller and the {!save} action. However, when a save is performed the user is take to the object record view rather then the retURL. How can I redirect the user to the correct page after performing a save action?
Best Answer chosen by Admin (Salesforce Developers) 
ShikibuShikibu
I started a new discussion (and ended up posting a solution) here.
Message Edited by Shikibu on 08-20-2009 01:06 PM

All Answers

wesnoltewesnolte

Hey

 

How are you specifying the retUrl?

 

Wes

VintaraVintara
I've just been adding a retUrl paramater to the URL for the page, seems to work in most cases, including save actions on an edit of an existing record.
ShikibuShikibu

I wonder if this is a bug? I am having the same trouble. The following formula, as an "onclick javascript" custom button, correctly opens and prepopulates a new purchase_items__c, but when I press "save", I am taken to the new item rather than to the containing purchase order.

 

I'm sure that the retURL is correct, because the cancel button does take me back to the purchase order.

 

 

Here's the formula (I added spaces here for readability; it seems they must be removed for the formula to work):

navigateToUrl('{!URLFOR($Action.SFDC_Purchase_Items__c.New,null,

[retURL=URLFOR($Action.SFDC_Purchase_Order__c.View,SFDC_Purchase_Order__c.Id),

CF00N200000014eaJ=SFDC_Purchase_Order__c.Name,

CF00N200000014eaJ_lkid=SFDC_Purchase_Order__c.Id]

)}')

 

 

 

Message Edited by Shikibu on 08-20-2009 12:39 PM
ShikibuShikibu
I started a new discussion (and ended up posting a solution) here.
Message Edited by Shikibu on 08-20-2009 01:06 PM
This was selected as the best answer