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
PhryPhry 

Cancel button not working with VF redirect page

I'm trying to use a VF redirect page to auto fill a field when a user creates a new case under the case tab. The redirect is working and the field is being auto filled. The issue is when the cancel button is clicked on the new case. Instead of going back to the default case screen it states the "URL No Longer Exists". I also noticed the URL is missing the /o at the end that the default case link normally has when not using the VF redirect page. How can i get the cancel button to work properly with the VF redirect?
Thanks for any help

Below is the VF page and then the APEX class


<apex:page standardController="Account" extensions="newbuttonredirect" action="{!pageredir}">
</apex:page>

-------------------


public class newbuttonredirect
{
public newbuttonredirect(ApexPages.StandardController controller)
{
}
public Pagereference pageredir()
{
Pagereference newpage = new Pagereference ('/500/e?nooverride=1&cas16=Name:%0AAddress:%0APrimary Contact:%0ASecondary Contact:%0ADSLUsername:%0ADSL Password:%0ADSL Phone Number:%0ACABLE Modem MAC:%0AEMTA MAC:%0AShentel Phone Number:%0ASTB Serial number:%0AAvailability:%0AContact Customer Prior to Visit:%0ATicket Notes:%0AAware of Charges:%0ADirections:&retURL=/500/');
return newpage;
}
}



cml26sepcml26sep

You need to just change the retURL to '/500/o' when initializing the newpage pagerefernce and it will work.