• paul rodgers 3
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I'm drawing a blank on how to use the standard {!Save} function in my visualforce on the command button. Basically after I click Save I want to redirect the page into a new page.

Here is my VF page code

<apex:page standardController="Lead" recordSetVar="leads" id="thePage" showHeader="true" sidebar="false" extensions="extContactApprovalPage" >
 
  <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!leads}" var="l">
                <apex:column >
                    <apex:outputField value="{!l.Name}"/>
                    <apex:facet name="header">Registrant Name</apex:facet>
                </apex:column>
               
                <apex:column >
                    <apex:outputField value="{!l.Approve_Picklist__c}"/>
                    <apex:facet name="header">Approve Picklist</apex:facet>
                </apex:column>
                <apex:column >
                    <apex:outputField value="{!l.Approve_Checkbox__c}"/>
                    <apex:facet name="header">Approve Checkbox</apex:facet>
                </apex:column>
               
              <apex:inlineEditSupport event="onClick" showOnEdit="saveButton, cancelButton"/>
             
          </apex:pageBlockTable>
          <apex:pageBlockButtons >
                <!--<apex:commandButton value="Edit" action="{!save}" id="editButton" />-->
                <apex:commandButton value="Save" action="{!save}" id="saveButton" reRender="none" />
                <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
            </apex:pageBlockButtons>
      </apex:pageBlock>
 
  </apex:form>
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page: ContactApprovalPage
  <!-- End Default Content REMOVE THIS -->
</apex:page>

and here is my extension:

public class extContactApprovalPage {

    public extContactApprovalPage(ApexPages.StandardSetController controller) {
      
    }
   
    public PageReference save(){
       
        
        PageReference reRend = new PageReference('/003');
        return reRend;
    }

}

Any assistance would be great thanks.