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

Maps in the value of an inputField...
<apex:page controller="Lilly_Customer_Manager"> <apex:form > <apex:repeat value="{!$ObjectType.Account.FieldSets.Lilly_Customer_Manage}" var="f"/> <apex:outputPanel id="pleaseWork"> <apex:repeat value="{!actFldMap}" var="act"> <apex:pageBlock title="{!$ObjectType[act].label}"> <apex:pageBlockButtons > <apex:commandButton action="{!mySave}" immediate="true" Value="Save" rendered="{!IF(act == 'Account','true','false')}"/> <apex:commandLink action="{!myNew}" immediate="true" rerender="pleaseWork" Value="New {!$ObjectType[act].Label}" rendered="{!IF(act != 'Account','true','false')}"> <apex:param name="str" value="{!act}" assignTo="{!tabButton}"/> </apex:commandLink> </apex:pageBlockButtons> <apex:repeat value="{!tabIdMap[act]}" var="aciId"> <apex:pageBlockSection title="{!aciNameLookup[aciId]}" columns="2" collapsible="true"> <apex:repeat value="{!newFields[aciId]}" var="aci"> <apex:inputField rendered="{!IF(aci['Type__c'] == 'PICKLIST' || aci['Type__c'] == 'MULTIPICKLIST','false','true')}" label="{!aci['Field_Label__c']}" value="{!aci[fldLookup[aci['Type__c']]]}"/> <apex:selectList rendered="{!IF(aci['Type__c'] == 'PICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plv[aciId + '.' + aci['Field_Name__c']]}" size="1" multiselect="false"> <apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/> </apex:selectList> <apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aciId + '.' + aci['Field_Name__c']]}" size="5" multiselect="true"> <apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/> </apex:selectList> </apex:repeat> </apex:pageBlockSection> </apex:repeat> </apex:pageBlock> <apex:repeat > </apex:repeat> </apex:repeat> </apex:outputPanel> </apex:form> </apex:page>
I am using this page for a change request system and it works perfectly to display the information in question, however it will not update it. When I attempt to write it back to the database the original value is store, and the apex debug statement shows the object behind it matches the original value and not the value updated via the form. Here is the db write statement...
public PageReference mySave(){ Account_Change_Request__c acr = new Account_Change_Request__c(); acr.Status__c = 'Submitted'; if(!actId.equals(''))acr.Account__c = actId; Database.SaveResult sr = Database.insert(acr); String parId = ''; if(sr.isSuccess()){ parId = sr.getId(); List<Account_Change_Item__c> ins = new List<Account_Change_Item__c>(); for(String s : newFields.keySet()){ for(Account_Change_Item__c aci : newFields.get(s)){ aci.Account_Change_Request__c = parId; System.debug('Field:' + aci.Field_Name__c + ' Value:' + aci.get(fldLookup.get(aci.Type__c))); ins.add(aci); } } insert ins; }else{ String err = ''; for(Database.Error e : sr.getErrors()){ err += '\n' + e.getMessage(); } ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Failed to create object\n' + err)); } PageReference ret = null; if(!parId.equals(''))ret = new PageReference('/apex/LILLY_Account_Change_Request?id=' + parId); return ret; }
Any idea why when I update the values in the UI, the change is not reflected it the Account_Change_Item__c?
Problem was the immediate set to true