+ Start a Discussion

Saving related list inline editing Visualforce

Hello everyone,


I'm building a VF page where I have custom object related to an Opportunity. I've got everything built but can not get the edits to to save from the VF page to the actual record. Code is below, any help would be much appriciated. 


<apex:page standardController="Opportunity" sidebar="false" >
<apex:form >
<apex:sectionHeader title="{!Opportunity.name}"/>
<apex:pageBlock mode="inlineEdit" title="Equipment">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!quicksave}"/>
<apex:commandButton value="Close" onClick="window.top.close();"/>
<apex:pageBlocktable value="{!Opportunity.Equipment__r}" var="equipment" >
<apex:column headerValue="Remove">
<apex:inputCheckbox value="{!equipment.Remove_Equipment__c}" />
<apex:column headerValue="Reciever R#">
<apex:outputField value="{!equipment.Name}"/>
<apex:column headerValue="Receiver S#">
<apex:outputField value="{!equipment.Receiver_S__c}"/>
<apex:column headerValue="Receiver Model">
<apex:outputField value="{!equipment.Receiver_Model__c}"/>
<apex:column headerValue="Programming">
<apex:outputField value="{!equipment.Programming__c}">
<apex:inlineEditSupport event="ondblclick"/>
<apex:column headerValue="Status">
<apex:outputText value="{!equipment.Statis__c}"/>
<apex:commandButton action="{!quicksave}" value="Save"/>
<apex:commandButton onClick="window.top.close();" value="Close" />


Is is the related objects that aren't saving?  That is expected behaviour.  The standard controller save only write back the changes to the object being managed - it doesn't traverse the object graph and write back all reachable objects.  You'll need to create an extension controller that writes back the related list and then invokes the standard object save.


Thanks for the reply, can you point me to an example of the extension needed?


This is pretty much the use case from one of my blog posts at:




This is an account and its related contacts, so should be straightforward to adapt.

How do we save  the data from the inline VF  page used on a standard page as related list?
Julija KlimecaJulija Klimeca
Hi , have you write the appropriate apex class for this task? Because right now I am dealing with the same issue.