You need to sign in to do that
Don't have an account?
NMackey
URLFOR and RetUrl
I've got a VF page that displays data from a few custom sObjects and have command buttons to create new objects using the following code.
<apex:commandButton action="{!URLFor($Action.Currency_Pair__c.New)}" value="New Currency Pair" />
The problem with this code is it automatically generated a RetUrl paramater bringing users back to the VF page without showing them the saved record as is default behavior in the Salesforce UI.
How do can I specify no RetUrl here?
I don't think there's a simple answer to this unfortunately. I tend to use the actual URL for creation (which can change between sandbox and production, in which case I store it in a custom setting) or execute a javascript function when the button is clicked that removes the returl parameter.
That's disappointing. I really like URLFOR although it's quite poorly documented.
What I was originally doing was getting the required new URL via an sObject describe call so I'll have to revert to that solution. It just adds more overhead and another workaround!
I can't harcode URLs in a custom setting unfortunately, the app I'm working on is going to be available as a managed package on AppExchange.