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 

Custom button function be over written by VF redirect page

I'm having an issue with a VF redirect being used for new case button. It is now over riding some of the actions on a create case custom button. The create case button is used when a customer is found in the salesforce database. Create case would normally auto fill a number of fields on a case such as customer's first/last name, phone#, etc from the account in salesforce. I also have a New case button to be used when a customer is not found in the database. This New case button is linked to a VF page that redirects the user to a blank case with the exception of the internal comments filled in with a template that the user uses to get info for the case. Currently since the VF redirect page was activated for the New case button, the Create case button is also being redirected to the NEW case layout and not auto filling info from the customer account in sales force like it was previous when the NEW case button was not using the redirect. I can set the New case button back to the default and the creat case again works liek it should filling info in the fields from the case. I can also see with the URL that when Create case button is clicked it is using the redirect setup for the NEw case button with VF page and pex class listed below. I would like to have the create case button still pull the info from the customers account and auto fill a created case as well as having the NEW case button function to auto fill it's internal comments field. Any help that can be provided would be great appreciated. Below is the code for the custom create case button url and the VF page plus apex code for the redirect to be used with the New case button.  Thanks for any help with this issue.

 

Create case custom button-

https://na8.salesforce.com/setup/ui/recordtypeselect.jsp?ent=Case&retURL=%2F500%2Fo&save_new_url=%2F500%2Fe%3FretURL%3D%252F500%252Fo&00NC00000059fMt={!Account.First_Name__c}&00NC00000059fMy={!Account.Last_Name__c}&00NC00000059fMG={!Account.Email__c}&cas4={!Account.Name}&cas16=Name:%0AAddress:%0APrimary Contact:%0ASecondary Contact:%0ADSL
Username:%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:


 

New Button Redirect VF page-

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

</apex:page>

 

New Button Redirect Apex class -

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/o');
    return newpage;
}
}