You need to sign in to do that
Don't have an account?
ethanone
Edit multiple records with a list controller extension
I'm trying to edit multiple records with a list controller extension. I want to use the standard controller {!Save} action, so I only need to use the extension to limit the records I want to show up in my list. The problem is that when I include the list controller extension in my VF page, my edits are not saved. Below is my code for page and extension respectively. Please let me know what I'm doing wrong. If I need to write a custom {!Save} action, please help guide me on how to do that. Thanks for your help!
Visualforce page (called customCommissionEdit):
The lda_Commission__c object that I'm trying to edit is a child to another object, so I just want the user to edit the related child lda_Commission__c.
Visualforce page (called customCommissionEdit):
<apex:page standardController="lda_Commission__c" recordSetVar="TheseCommissions" extensions="extCustomCommissionList"> <apex:form > <apex:pageBlock > <apex:pageMessages ></apex:pageMessages> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="quicksave" action="{!quicksave}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!TheseCommissions}" var="comm"> <apex:column value="{!comm.name}"/> <apex:column value="{!comm.Agent_Order__c}"/> <apex:column value="{!comm.Agent__c}"/> <apex:column value="{!comm.Comm_Dollars__c}"/> <apex:column value="{!comm.Comm_Pct__c}"/> <apex:column headerValue="Commission Percent"> <apex:inputField value="{!comm.Comm_Pct__c}"/> </apex:column> <apex:column value="{!comm.LAO_Agent__c}"/> <apex:column value="{!comm.Role__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>Controller extension (called extCustomCommissionList):
public with sharing class extCustomCommissionList { public extCustomCommissionList(ApexPages.StandardSetController controller) { } public list<lda_Commission__c> getTheseCommissions() { return [SELECT DealID__c, Name, Agent__c, LAO_Agent__c, Agent_Order__c, Comm_Dollars__c, Comm_Pct__c, Fiduciary__c, Role__c FROM lda_Commission__c WHERE DealID__c = :ApexPages.currentPage().getParameters().get('id')]; } }
The lda_Commission__c object that I'm trying to edit is a child to another object, so I just want the user to edit the related child lda_Commission__c.
Controller: