I'm trying to add an <apex:outputLink />
tag to a VF page and use the URLFOR()
function to direct the user to create a new Case. I want it so that when they save or cancel on the new Case creation page they are redirected to the detail page of a custom object. My code is below.
<apex:outputLink value="{!URLFOR($Action.Case.NewCase, null, ['retURL'=URLFOR($Action.Custom_Object__c.View, 'a0A00000000IDID')], true)}" >Select</apex:outputLink>
My problem is that some users are first taken to the Record Type selection screen. Pressing cancel from this screen takes the User to my Custom Object detail page, but if they continue to the new Case screen and THEN hit cancel they are redirected to the VF page, or if they press save they are taken to the Case detail page. I've tried adding cancelURL
and saveURL
but they don't preserve through the Record Type selection screen.
How can I preserve the retURL through the Record Type selection screen? I must allow users to select a Record Type so hard coding this is not an option.