+ Start a Discussion
Nicholas DallNicholas Dall 

How do I create a visualforce page that doesn't constantly look like it's being edited?

I have created a visualforce page for my team to enter new opportunities. It is my first visualforce page. I can't get it, though, to "save"; it always looks like it is being edited. Here's what my code looks like:

<apex:page standardController="Opportunity">
  
  <h1><center>Hello {!$User.FirstName}</center></h1>
  <center>Please enter the following information</center>
  
  <br></br><br></br>
  
  <apex:form >
      <apex:pageBlock >
        <center><h1>Current Stage</h1></center>
            <i><center>Please leave boxes checked once a project has completed a stage<hr></hr></center></i>
          <br></br>
                  <div align="center" draggable="false" >
                    <apex:commandButton value="Save" action="{!save}"/>
                    <apex:commandButton value="Edit" action="{!edit}"/>
                  <hr></hr></div>   
            <apex:pageblocksection columns="1">
          
              <apex:pageblocksectionitem >
                  Information Sharing    <apex:inputCheckbox value="{!opportunity.Information_Sharing__c}"/>          
              </apex:pageblocksectionitem>
                       
              <apex:pageblocksectionitem >
                  Project Specific RFI    <apex:inputCheckbox value="{!opportunity.Project_Specific_RFI__c}"/>          
              </apex:pageblocksectionitem>
                       
              <apex:pageblocksectionitem >
                  EDCUtah Site/Data RFI    <apex:inputCheckbox value="{!opportunity.EDCUtah_Site_Data_RFI__c}"/>          
              </apex:pageblocksectionitem>
                       
              <apex:pageblocksectionitem >
                  Site Visit    <apex:inputCheckbox value="{!opportunity.Site_Visit__c}"/>          
              </apex:pageblocksectionitem>
                       
              <apex:pageblocksectionitem >
                  Incentive Process    <apex:inputCheckbox value="{!opportunity.Incentive_Process__c}"/>          
              </apex:pageblocksectionitem>
                                                                             
            </apex:pageblocksection>  
      </apex:pageBlock>
  </apex:form>  
      
  <apex:form >
      <apex:pageBlock >
        <center><h1>Contact Information</h1></center>
          <br></br>
          <apex:pageblocksection >
              
              <apex:pageblocksectionitem >
                  Project Name    <apex:inputfield value="{!Opportunity.Name}"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Company Name    <apex:inputfield value="{!opportunity.accountid}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Open Date        <apex:inputfield value="{!opportunity.Open_Date__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Projected Close Date    <apex:inputfield value="{!opportunity.CloseDate}" required="True"/>
              </apex:pageblocksectionitem>
              
                                <apex:outputfield value="{!Opportunity.ownerID}"/>
              <apex:pageblocksectionitem >
                  Secondary Project Owner    <apex:inputfield value="{!opportunity.Secondary_Project_Owner__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Contact    <apex:inputfield value="{!Opportunity.Contact__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Lead Source    <apex:inputfield value="{!opportunity.leadsource}" required="true"/>
              </apex:pageblocksectionitem>
                  
          </apex:pageblocksection>   
      </apex:pageBlock>
  </apex:form>  



  <apex:form >
     <apex:pageBlock >
        <center><h1>Reportable Numbers</h1></center>
            <br></br>
            <apex:pageblocksection >
              
              <apex:pageblocksectionitem >
                  New Jobs Created    <apex:inputfield value="{!opportunity.New_Jobs_Created__c}" required="True"/>
              </apex:pageblocksectionitem> 
              
              <apex:pageblocksectionitem >
                  Existing Jobs Retained    <apex:inputfield value="{!opportunity.Existing_Jobs_Retained__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Capital Investment    <apex:inputfield value="{!opportunity.Capital_Investment__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Acreage        <apex:inputfield value="{!opportunity.Acreage__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Square Footage    <apex:inputfield value="{!opportunity.Square_Footage__c}" required="True"/>
              </apex:pageblocksectionitem>
              
               <apex:pageblocksectionitem >
                  Power Requirements    <apex:inputfield value="{!opportunity.Power_Requirements__c}" required="True"/>
              </apex:pageblocksectionitem>
                             
          </apex:pageblocksection>   
      </apex:pageBlock>
  </apex:form>
  
  
  <apex:form >
     <apex:pageBlock >
        <center><h1>Other Reportable Information</h1></center>
            <br></br>
            <apex:pageblocksection >
              
              <apex:pageblocksectionitem >
                  Facility Function/Type    <apex:inputfield value="{!opportunity.Facility_Function_Type__c}" required="True"/>
              </apex:pageblocksectionitem>
               
              <apex:pageblocksectionitem >
                  Decision Drivers    <apex:inputfield value="{!opportunity.Decision_Drivers__c}" required="True"/>
              </apex:pageblocksectionitem>
               
              <apex:pageblocksectionitem >
                  Project Timeline    <apex:inputfield value="{!opportunity.Project_Timeline__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Real Estate Considered    <apex:inputfield value="{!opportunity.Real_Estate_Considered__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Location(s) Considering    <apex:inputfield value="{!opportunity.Locations_Considering__c}" required="True"/>
              </apex:pageblocksectionitem>
               
              <apex:pageblocksectionitem >
                  Competition    <apex:inputfield value="{!opportunity.ND_Competition__c}" required="True"/>
              </apex:pageblocksectionitem>
              
              <apex:pageblocksectionitem >
                  Strategic Benefit    <apex:inputfield value="{!opportunity.Strategic_Benefit__c}" required="True"/>
              </apex:pageblocksectionitem>
              
      </apex:pageblocksection>   
    </apex:pageBlock>
  </apex:form>  
    
  
  <apex:form >
      <apex:pageblock > 
          <apex:pageblocksection >
              <apex:commandbutton >
                  <center><apex:commandButton title="New Event or Task" value="New Task" onclick="window.open('/00T/e?','_blank','width=600,height=600,location=no,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=1', 1)"/></center>
              </apex:commandbutton>
          </apex:pageblocksection>
      </apex:pageblock>
  </apex:form>
             
</apex:page> 
asapjimasapjim
Hi, on the Setup->Customize->Opportunities->Buttons, Links, and Actions settings page, what is the setting for View?  is it a standard sales for page? 
Nicholas DallNicholas Dall
It is currently set to view my Visualforce page, which is working just fine. When I view an opportunity (we call it a project), the fields look like this (these snapshots are of different fields, but are on the same page – disregard that they are not the same fields) [cid:image001.jpg@01D1B739.9522F4D0] Instead of like this [cid:image002.jpg@01D1B739.9522F4D0]. What am I doing wrong?
asapjimasapjim
Hi, if you want use a VF page for the view, I believe you will need to create a second page that uses apex:outputfields instead of apex:inputfields.  Alternatively, if it will work with your design you could set the View setting back to the standard SFDC page.  Hope this helps!