You need to sign in to do that
Don't have an account?

Save button extension
Hi Expertz,
I am working on some functionality that when even a user clicks on Save button a new VF form should comes up alogn with some differemnt fields.
Then when ever user click the OK button on the new VF page all the data should commit to Salesforce.
I don't have any clues for this that how to even start as i a newbie, Kinldy assists.
Thanks
Sachin Sharma
I am working on some functionality that when even a user clicks on Save button a new VF form should comes up alogn with some differemnt fields.
Then when ever user click the OK button on the new VF page all the data should commit to Salesforce.
I don't have any clues for this that how to even start as i a newbie, Kinldy assists.
Thanks
Sachin Sharma
that's because you've overridden the Save command and it running it from your extension....where the only code is to perform the page redirect. You'll need to write a save dml statement there before the redirect.
For this you have to develop wizard kind of page. You have to develop custom apex code and custom vf page to accomplish this.
Thanks for your responses, But i have one more issue with the same.
Using action method, I am able to save the Record data and able to navigate this to the new page, but when user navigate to the other page. I want to save the new page data as chlid record for the first page. but i not able to find the way in which i can carry the First page record ID to the second page.
Kindly help.
Thanks
Sachin.
After saving the first page record, you can redirect the page with Record Id and you can get Parent Id from there.
Ex:
Save method from first page should work like above and second page controller should get the parent id from the url and create child record.
but its not working in case of the Self Loopkup relation ship.
class code and VF page below...
VF Page-----------------------------
<apex:page standardcontroller="LazyEmployee__c" extensions="LazyEmployeeController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Cancel" action="{!Cancel}" />
</apex:pageBlockButtons>
<apex:pagemessages ></apex:pagemessages>
<apex:pageBlockSection columns="2">
<apex:inputfield value="{!LazyEmployee__c.Field_1__c}"/>
<apex:inputfield value="{!LazyEmployee__c.Field_2__c}"/>
<apex:inputfield value="{!LazyEmployee__c.LazyEmployee_SelfLookUp__c}"/>
<apex:inputfield value="{!LazyEmployee__c.LazyEmployee_SelfLookUp_Parent__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
And Class is ----------------------------------------------
public class LazyEmployeeController{
LazyEmployee__c obj;
string str;
public LazyEmployeeController (ApexPages.StandardController controller){
this.obj= (LazyEmployee__c) Controller.getRecord();
}
public PageReference Save() {
insert obj;
PageReference ReturnPage = new PageReference('/LazyEmpPage?parentID='+obj.id);
return ReturnPage ;
}
}