I have below code to update the input text field value for OUTCOME field from the User. My list update is failing to happen without throwing any exception. Please can someone help me here?

My Controller class snippet to update list values:
  public pagereference save()
    //Added by Spandan 03/12
   // update oIncTranList;//set list
   update oIncTranListHCPDetail ;
   update oIncTranListHCI ;
   update oIncTranListPharmacy;
   update oIncTranListHCPSamples;
   update oIncTranListHCPSpeaker;
   update oIncTranListSynch;

    System.debug('Spandan List$$$$$$$$$$$$$$$$$$$'+oIncTranListHCI );
    ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'New values saved');
    return null;

My Page code snippet where input field OUTCOME is an User entry and needs to be updated in salesforce:

<apex:outputPanel layout="none" rendered="{!IF(oIncTranListPharmacy.size>0, true, false)}">
        <apex:tabPanel >
        <apex:tab label="Pharmacy Calls" >
        <apex:form >

         <apex:pageBlockTable columns="10" value="{!oIncTranListPharmacy}" border="true" var="itr" cellPadding="4" >
         <div class="page-break" >
    <!-- Your content -->
        <apex:column headerValue="Account Name" style="background-color:#FFFFFF;" value="{!itr.Incident_Transaction_abv__r.Call_abv__r.account_vod__r.Name}" />
        <apex:column headerValue="ABS on Call" style="background-color:#FFFFFF;" value="{!itr.Incident_Transaction_abv__r.Call_abv__r.account_vod__r.Abbott_Best_Specialty_ABT__c}" />
        <apex:column headerValue="Account Address" style="background-color:#FFFFFF;" value="{!itr.Incident_Transaction_abv__r.Call_abv__r.Address_Line_1_vod__c}" />
        <apex:column headerValue="Attendee Name" style="background-color:#FFFFFF;" value="{!itr.Attendee_abv__r.Name}" />
        <apex:column headerValue="Attendee Role" style="background-color:#FFFFFF;" value="{!itr.Attendee_Call_abv__r.Attendee_Role_CIA__c}" />
        <apex:column headerValue="Detail" style="background-color:#FFFFFF;" value="{!itr.Call_Detail_abv__r.Product_vod__r.Name}" />
        <apex:column headerValue="Activity Date" style="background-color:#FFFFFF;" value="{!itr.Incident_Transaction_abv__r.Call_abv__r.Call_Datetime_vod__c}" />
        <apex:column headerValue="Outcome" >
                    <apex:inputField value="{!itr.Outcome_abv__c}" rendered="{!Incident_abv__c.Confirm_Attestation_abv__c == false}"/>   
                    <apex:outputField value="{!itr.Outcome_abv__c}" rendered="{!Incident_abv__c.Confirm_Attestation_abv__c == true}"/>                       
        <apex:commandButton action="{!save}" rendered="{!Incident_abv__c.Confirm_Attestation_abv__c == false}" value="Save changed values" id="theButton"/>

  • You have posted so much Apex and Visualforce that when it is formatted so it can be seen clearly the posting size limit is exceeded. Can you cut out the irrelevant lines and use the code formatting button so the code can be seen? – Keith C Dec 4 '14 at 9:08
  • Hi Keith, Please find my concern editted with exact code snippets. Please help me to solve the issue. Thanks in advance! – Testing_SFDC Dec 4 '14 at 9:22
  • You still need to select the Apex and use the 101010 button and then select the Visualforce and use the 101010 button. – Keith C Dec 4 '14 at 9:30
  • Hi Keith! I am sorry I didn't get what you said. Can you please elaborate it for me? – Testing_SFDC Dec 4 '14 at 9:33
  • 2
    OK I've done the formatting and will take a look. Please in future only post formatted code. – Keith C Dec 4 '14 at 9:50

Is it possible that your action="{!save}" is calling the Save method in the Standard controller? I can't see the <apex:page> tag in the posted code, so I cant be sure.

Try renaming your method and see if that helps.

| improve this answer | |
  • That is fine, but problem I face is that one section refers to data to Object A and the rest to Object B. Object A list is not getting updated – Testing_SFDC Dec 4 '14 at 10:26
  • okay. That again makes me wonder if the standard controller's save method is being called, which will save the record for that object, but not the other. So did you try renaming your custom save method? – AslamK Dec 4 '14 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.