You need to sign in to do that
Don't have an account?

apex:enhancedList custom controller constructor doesn't update different object
I have an apex page where I'm using an enhancedList tag, and a custom controller. In the custom controller's constructor, I try to update a different object (different than what the enhancedList is using). It doesn't seem to work. Hopefully, I'm making a mistake that's obvious to someone else.
Code:
<apex:page controller="smemController"> <apex:pageBlock > <apex:form > </apex:form><br/> <apex:enhancedList type="Contact" height="500" id="ML"></apex:enhancedList> </apex:pageBlock> </apex:page> /// Here's the controller: public class smemController { public void smemController() { List<User> meList = [SELECT ID, FirstName, LastName, CURRENT_MAIL_LIST__c FROM User WHERE ID = :UserInfo.getUserId() LIMIT 1]; User me = meList[0]; String fullName = me.FirstName + ' ' + me.LastName; List<Mail_List__c> myLists = [SELECT ID, CHANGE_ME__c, LIST_NAME__c, CURRENT_LIST__c, Name, DUMPSTER__c FROM Mail_List__c WHERE LIST_OWNER__c = :fullName]; for (integer i=0; i < myLists.size(); i++) { myLists[i].CURRENT_LIST__c = false; myLists[i].DUMPSTER__c = 'Was Hit'; } update myLists; } }