You need to sign in to do that
Don't have an account?
Redirect the same page in master page after creation of child??
i have developed One VF Page:
1.How to redirect the Same page after saving the record???
2.How to Implement Save & New Functionality ???
VF Page
<apex:page standardController="Work_Performed__c">
<apex:form >
<apex:pageBlock title="Work performed">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Work Performed" columns="2" collapsible="true" dir="LTR" id="My">
<apex:inputField value="{!Work_Performed__c.Note__c}"/>
<apex:inputField rendered="false" value="{!Work_Performed__c.Case_Number__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Hi,
You can't achieve this using standared controller.
You need to use controller extension or Controller for this.
Modify your VF code like below and let's say page name is "saveandnew"
Create new apex class,the controller code will be
Try this Code.
your problem will be solved and you will be redirected to same page after saving the record,i.e save and new Functionality.
Hi Hari,
Thanks for your response....
It is Redirecting to same page Work performed detail Page.but i want to redirect to Case Detail Page.....
Hi,
If you want to redirect to detail page, then chage the redirection path.
just change below line you will be redirected to detail page.
PageReference pageRef = new PageReference('/'+sController.getrecord().id);
Now your code seems like below: