I have added inlineEditSupport and save function to pageblocktable on Case object. I want to save values in inputField "Case Review Notes" field (Case_Comments_On_VFReport__c). When I click on Save button, it does save value, but only on UI. When I refresh page, value is gone. Also when I tried to query Case_Comments_On_VFReport__c in devconsole I don't see any update on this field.

Can you guys please help me here with code?

Visualforce Page

<apex:page controller="VF_CaseSearch" action="{!searchCase}" tabStyle="Case" sidebar="false">
    <apex:form >

            <apex:pageblockSection >
                <apex:inputText value="{!cas.CaseNumber}" label="Search Case Number"/>
            <!---Search Button--> 
            <apex:pageblockButtons location="bottom">
                <apex:commandButton value="Search" action="{!searchCase}"/>
        <apex:pageBlock title="Case Details" id="details" rendered="{! IF( caseList != null && caseList.size >0, true, false)}" mode="edit">
            <apex:pageBlockTable value="{!caseList}" var="c">  
                <apex:column value="{!c.CaseNumber}" headerValue="Case Number"/>
                <apex:column value="{!c.CreatedDate}" headerValue="Created Date"/> 
                <apex:column value="{!c.Status}" headerValue="Status"/>
                <apex:column value="{!c.Severity__c}" headerValue="Priority"/>
                <apex:column headerValue="Case Review Notes">
                    <apex:inputField value="{!c.Case_Comments_On_VFReport__c}" />
           <apex:inlineEditSupport />
                    <!---Save Button -->
                    <apex:pageBlockButtons html-align="left" location="top">
                          <apex:commandButton value="Save" action="{!save}" />

Custom Controller

public with sharing class VF_CaseSearch {

  public Case cas{get;set;}
  public List<Case> caseList {get;set;}
  List<string> conditions = new List<string>();
    public VF_CaseSearch(){
      cas = new Case();
  public void searchCase(){
      if(caseList !=null && caseList.size()>0){
      searchCases ();
  public Void searchCases(){
      if(caseList != null && !caseList.isEmpty()){

      //create a dynamic query for filter results
      String strQuery ='SELECT Id, CaseNumber, CreatedDate, Status, Severity__c, Case_Comments_On_VFReport__c, FROM Case';
      if(cas.CaseNumber !=null && cas.CaseNumber !=''){
          conditions.add('CaseNumber Like\'%' +cas.CaseNumber +'%\' ');
      if (conditions.size() > 0) {
          strQuery += '  WHERE  ' + conditions[0];
          for (Integer i = 1; i < conditions.size(); i++)
              strQuery += '  AND  ' + conditions[i];
      caseList = Database.query(strQuery);
     // Save button
     public PageReference save(){
            system.debug('caseList'+ caseList);
            return ApexPages.CurrentPage();
        catch(DMLException e){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,e.getMessage()));
        return null;


1 Answer 1


For anyone in future looking for answer, here is what I did after receiving a suggestion from Salesforce Developer Forum. Remove comma before FROM and add "false" to Database.update(caseList, false).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .