function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
silvrhawk9silvrhawk9 

Cannot Get field to save

cannot get this field to save

 

this is the code i am using. it displays perfectly but when my users go to save it reverts back to an empty field

any suggestions or do i need to include more code?

 

 

</apex:PageblockSection>

  <apex:pageBlockSection title="Cross-Sell/Up-Sell" collapsible="true" columns="2">
                <apex:inputField value="{!Call_crm__c.Upsells__c}"/>
              
  </apex:pageBlockSection>  

DevNVDevNV

What else do you have on the VF page?  You need to refer to a standard Controller for the custom object and add a save button.

 

 

<apex:page standardController="Call_crm__c">
  <apex:form >
  <apex:pageBlock mode="edit">
      <apex:pageBlockButtons >
          <apex:commandButton action="{!save}" value="Save"/>
          <apex:commandButton action="{!cancel}" value="Cancel"/>
      </apex:pageBlockButtons>
  <apex:pageBlockSection title="Cross-Sell/Up-Sell" collapsible="true" columns="2">
                <apex:inputField value="{!Call_crm__c.Upsells__c}"/>
              
  </apex:pageBlockSection>  
  </apex:pageBlock>
  </apex:form>
</apex:page>

 



That will give you the buttons and should save the value.  If you put id=xxxxx in the URL after your vF page name then it will bring up that Call crm record with the current Upsells value, and then the change you make should be saved back to that record.

 

Hope that helps

silvrhawk9silvrhawk9

here is the full page.

i do reference the standard controller and have a save button

 

any help is greatly appreciatted

 

<apex:page standardController="Call_crm__c"
    extensions="CallInteractionExtension" id="CallDetail" tabstyle="Call_crm__c">
<body onload="document.CallDetail:Form:PageBlock:PageBlockSection:Address:AddressList.focus();">
<apex:includeScript value="{!$Resource.jQuery}/jquery-validate/jquery-1.4.4.min.js" />
 <apex:form id="Form">
 <apex:outputpanel id="err">
    <apex:pagemessages />
 </apex:outputpanel>   
 <apex:actionStatus startText="Saving..." id="callstatus" />
 
 <apex:pageBlock mode="detail" id="PageBlock" >
 <apex:pageBlockSection columns="1">
    <apex:outputPanel >
     <table width="100%">
       <tr>
         <td style="width:12%" colspan="4">
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
          </td>
       </tr>

       <tr>

         <td class="labelCol" style="width:10%">Account Type  </td>

         <td style="width:15%">
            <apex:outputfield value="{!interaction.Account_crm__r.Account_Type_ods__c}" />
         </td>

         <td class="labelCol" style="width:10%">Specialty</td>

         <td style="width:15%"><apex:outputfield value="{!interaction.Account_crm__r.Specialty_ods__c}" /></td>

         <td class="labelCol" style="width:10%;">Methodolgy</td >

         <td style="width:33%"><apex:outputfield value="{!interaction.Account_crm__r.Methodolgy_crm__c}" />&nbsp;</td>
         </tr>
        
         <tr>
         <td class="labelCol" style="width:10%">Territory  
         </td>
         <td style="width:15%">
            <apex:outputfield value="{!interaction.Territory_crm__c}" />
         </td>
        
         <td class="labelCol" style="width:10%">Created By  
         </td>
         <td style="width:15%">
            <apex:outputText value="{!CreatedByInfo}" />
         </td>
       
        <td colspan="2" />
        
         </tr>
        
         </table>
      </apex:outputPanel>
 </apex:pageBlockSection>
 
  
  <apex:pageblocksection title="Interaction Details" id="PageBlockSection"  collapsible="true" columns="3">
    <apex:pageblocksectionitem >
     <apex:outputlabel value="Account Name" />
     <apex:outputfield value="{!interaction.Account_crm__r.Name}" />
    </apex:pageblocksectionitem>
            <apex:pageblocksectionitem id="attendeepbs">         
              <apex:outputpanel layout="block">
               <table>
                    <tbody><tr>
                    <td>
                     <select multiple="multiple" size="5" id="attendeelist" name="selSea">
                       <apex:repeat value="{!listcallAttendee}" var="ca">
                         <option value="{!ca.affiliationCrm.To_Account_crm__c}">{!JsEncode(ca.affiliationCrm.To_Account_crm__r.Name)} {!JsEncode(ca.affiliationCrm.Type_crm__c)}</option>
                       </apex:repeat>     
                     </select>
                    </td>
                    <td>
                     <input onclick="GLAttendee.addAttendee();" value="Add" class="btn" type="button"/>
                    </td>
                    </tr>
                    </tbody></table>
                    <div id="listAddedAttendee">
                     <table>
                      <tbody id="attendeebody">
                        <apex:repeat value="{!addedlistcallAttendee}"  var="ca">
                            <tr id="td_{!ca.affiliationCrm.To_Account_crm__c}">
                                <td>{!ca.affiliationCrm.To_Account_crm__r.Name} {!ca.affiliationCrm.Type_crm__c}</td>
                                <td><input type="button" class="btn" onclick="GLAttendee.deleteAttendee('{!JsEncode(ca.affiliationCrm.To_Account_crm__r.Name)} {!JsEncode(ca.affiliationCrm.Type_crm__c)}','{!ca.affiliationCrm.To_Account_crm__c}');" value="X"/></td>
                            </tr>
                        </apex:repeat>  
                    </tbody></table>
                    </div>                 
                    <apex:inputhidden id="addedCallAttendee" value="{!addedCallAttendee}"/>
                    <apex:inputhidden id="deletedCallAttendee" value="{!deletedCallAttendee}"/>
              </apex:outputpanel>
            </apex:pageblocksectionitem>
     
     <apex:pageblocksectionitem />
     <apex:pageblocksectionitem >
       <apex:outputlabel value="Interaction Date Time"/>
           <apex:outputpanel >
                   <apex:inputfield value="{!contact.BirthDate}" required="true"/>
                    <apex:selectList value="{!timestamp}" size="1">
                    <apex:selectOptions value="{!timeList}"/>
                </apex:selectList>                  
           </apex:outputpanel>
     </apex:pageblocksectionitem>

   
<apex:selectList value="{!Call_crm__c.Interaction_Type__c}" multiselect="true">
            <apex:selectOptions value="{!Call_crm__c.Interaction_Type__c}"/>
        </apex:selectList><p/>

    <apex:inputfield value="{!Call_crm__c.Interaction_Type__c}" required="true" />    
     <apex:inputfield value="{!interaction.Completed_crm__c}" />
    
     <apex:pageblocksectionitem id="Address">
     <apex:outputlabel value="Address" />
      <apex:selectList id="AddressList" value="{!interaction.Address_crm__c}"  size="1">
            <apex:selectOptions value="{!listOfAddress}"/>
        </apex:selectList>
    </apex:pageblocksectionitem>
   
     <apex:pageblocksectionitem >
           <apex:inputfield value="{!Call_crm__c.Call_Report_Type_crm__c}" />
     </apex:pageblocksectionitem>
   
 
   
    <!-- commented on 03/05/2011 guruk
    <apex:pageblocksectionitem rendered="{!IF(userTrs.size > 1 , true,false)}">
     <apex:outputlabel value="Territory" />
      <apex:selectList value="{!interaction.Territory_crm__c}"  size="1">
            <apex:selectOptions value="{!userTrs}"/>
        </apex:selectList>
    </apex:pageblocksectionitem>  
   -->
  
  </apex:pageblocksection>

<apex:pageblocksection title="Call Notes"   collapsible="true" columns="1">
 <apex:outputpanel >
    <table width="100%" >
          <tr>
            <td class="labelCol" style="text-align:left">
             Notes:
            </td>
          </tr>
          <tr>
            <td>
             <apex:inputTextarea value="{!interaction.Call_Note_crm__c}" rows="4" cols="140"/>
            </td>
          </tr>                 
           <tr>
            <td class="labelCol" style="text-align:left">
             Next Call Strategy:
            </td>
           </tr>
           <tr>
            <td style="width:250px">
             <apex:inputTextarea value="{!interaction.Next_Call_Strategy_crm__c}" rows="4" cols="140"/>
            </td>
          </tr>
        </table>
 </apex:outputpanel>

</apex:pageblocksection>

 

<apex:pageblocksection Title="Follow-up Actions" collapsible="true" columns="1" id="followupBlock">
   <apex:PageblockSectionItem >
   <apex:outputpanel >
      <table width="100%" >    
      
          <apex:repeat value="{!existingCallTask}" var="callTask">
           <tr>
           <td class="labelCol">
                  {!callTask.callTaskCrm.Followup_Task_Type_crm__r.Name}
            </td>
            <td>           
             <apex:inputcheckbox value="{!callTask.isSelected}" />
            </td>
             <td class="labelCol">
                 Date Completed
            </td>
            <td>           
             <apex:inputfield value="{!callTask.callTaskCrm.DateCompleted_crm__c}" />
            </td>
           </tr>          
          </apex:repeat>         
        </table>  
   </apex:outputpanel>
  
   </apex:PageblockSectionItem>

</apex:PageblockSection>
 

  <apex:pageBlockSection title="Cross-Sell/Up-Sell" collapsible="true" columns="2">
                <apex:inputField value="{!Call_crm__c.Upsells__c}"/>
  </apex:pageBlockSection>   
   
                               
</apex:form>
</body>
</apex:page>

Starz26Starz26

Just a quick thought as I did not review the entire code,

 

the standard {!save} function you are using only applies to data entered for the object controlled by the standard controller. If you are trying to save data to another object reference you will need to write a custom save function for those.