You need to sign in to do that
Don't have an account?
How to store Apex list to Object field and read it back
I need to save the selected options a user picks on a SelectList tag. On the controller snippet below, how can I save contractNumbers into a SalesForce object field ? Also, when I open the record up I need to load the save contractNumbers as the selected values for !SelectedSubmissions on the visualForce page.
public void getSelectedSubmissions() { // called by command button 'Select Submissions' try { this.submissionList = querySubmissionsById(this.SelectedSubmissions); for (Submissions__c sublist : submissionList) { string val1 = sublist.Name; //Just an example. Change as needed string val2 = sublist.SPD_REF_PS__c; string val3 = sublist.Company_Code__c; string contractNumber = val2 + this.ContractYear + val3; contractNumbers.add(contractNumber); }
<!-- Selection List --> <apex:selectList value="{!SelectedSubmissions}" multiselect="true"> <apex:selectOptions value="{!SubmissionOptions}"/> </apex:selectList><p/>