You need to sign in to do that
Don't have an account?
Shawn Reichner
Controller Extension for Standard Case Controller
Friends,
I have a Visualforce page that has been created, and what I want to do is when the Visualforce page is submitted to create a case by clicking on the save button on the Visualforce page, I want the user to be redirected to another visualforce page thanking the user for thier submission with the newly created case number.
I know I will have to create a Standard controller extention, but I am not familiar with this process at all, and any help would be very much appreciated.
Here is the Visualforce page code I have created, and for our example purposes the VF page for the redirect we will name Thank_You.
Please help however you can by telling me how to create a custom extentsion to add functionality to redirect to the Thank_You Visualforce page after the standard Save has been completed.
Thank you so much!
<apex:page standardController="Case">
<img src="{!$resource.AVISPL_Logo2}"></img>
<apex:pageBlock >
<apex:pageBlockSection title="Hello, Thank You For Your Project Request !" columns="1" showHeader="True" collapsible="False">
</apex:pageBlockSection>
</apex:pageBlock>
<apex:form >
<apex:pageBlock tabStyle="Case" title="Impact" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Number_of_Users_Affected__c}"/>
<apex:inputField value="{!Case.Area_s_Affected__c}"/>
<apex:inputField value="{!Case.Functionality_Affected__c}"/>
<apex:inputField value="{!Case.Profile_s_Affected__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Description Information" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Subject}"/>
<apex:inputField value="{!Case.Driver__c}"/>
<apex:inputField value="{!Case.Benefit_Of_Change__c}"/>
<apex:inputField value="{!Case.Reason_For_Change__c}"/>
<apex:inputField value="{!Case.Description}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Deadlines and Project Status" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Target_Deadline__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Requesting Department Information" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Sponsoring_Department_s__c}"/>
<apex:inputField value="{!Case.Sponsoring_Dept_GL_Code__c}"/>
<apex:commandButton value="Submit Change Request" action="{!Save}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
I have a Visualforce page that has been created, and what I want to do is when the Visualforce page is submitted to create a case by clicking on the save button on the Visualforce page, I want the user to be redirected to another visualforce page thanking the user for thier submission with the newly created case number.
I know I will have to create a Standard controller extention, but I am not familiar with this process at all, and any help would be very much appreciated.
Here is the Visualforce page code I have created, and for our example purposes the VF page for the redirect we will name Thank_You.
Please help however you can by telling me how to create a custom extentsion to add functionality to redirect to the Thank_You Visualforce page after the standard Save has been completed.
Thank you so much!
<apex:page standardController="Case">
<img src="{!$resource.AVISPL_Logo2}"></img>
<apex:pageBlock >
<apex:pageBlockSection title="Hello, Thank You For Your Project Request !" columns="1" showHeader="True" collapsible="False">
</apex:pageBlockSection>
</apex:pageBlock>
<apex:form >
<apex:pageBlock tabStyle="Case" title="Impact" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Number_of_Users_Affected__c}"/>
<apex:inputField value="{!Case.Area_s_Affected__c}"/>
<apex:inputField value="{!Case.Functionality_Affected__c}"/>
<apex:inputField value="{!Case.Profile_s_Affected__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Description Information" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Subject}"/>
<apex:inputField value="{!Case.Driver__c}"/>
<apex:inputField value="{!Case.Benefit_Of_Change__c}"/>
<apex:inputField value="{!Case.Reason_For_Change__c}"/>
<apex:inputField value="{!Case.Description}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Deadlines and Project Status" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Target_Deadline__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Requesting Department Information" >
<apex:pageBlockSection >
<apex:inputField value="{!Case.Sponsoring_Department_s__c}"/>
<apex:inputField value="{!Case.Sponsoring_Dept_GL_Code__c}"/>
<apex:commandButton value="Submit Change Request" action="{!Save}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Try below code :-
VF page
Apex Class
If this helps,please mark it as best answer to help others.
All Answers
Try below code :-
VF page
Apex Class
If this helps,please mark it as best answer to help others.
Put this line after line 13.
Here is the complete code:
public class CaseController{
public Case cse{get;set;}
public CaseController(ApexPages.StandardController controller)
{
cse=new Case();
}
public pagereference Save()
{
insert cse;
PageReference pg=Page.Change_Project_Thank_You;
Case c = [select Casenumber from Case where id=:cse.id];
system.debug('#######' + c.Casenumber )'
pg.setredirect(false);
return pg;
}
}
public pagereference Save()
{
insert cse;
PageReference pg=Page.Change_Project_Thank_You;
Case c = [select Casenumber from Case where id=:cse.id];
system.debug('#######' + c.Casenumber )'
pg.setredirect(false);
return pg;
}
}
to
public pagereference Save()
{
insert cse;
PageReference pg=Page.Change_Project_Thank_You;
Case c = [select Casenumber from Case where id=:cse.id];
system.debug('#######' + c.Casenumber );
pg.setredirect(false);
return pg;
}
}
Again thank you for your help, is there anythign else we can try?
Shawn
this should work.Can you debug the issue by setting the debug logs on for theu user.