You need to sign in to do that
Don't have an account?
Conversion Error setting value- Showing Multi-select picklist as checkboxes on VF page.
This code displays a multi-select picklist as checkboxes perfectly on a Visualforce page, but when clicking the save button, it shows this error.
Conversion Error setting value 'Its complicated' for '#{Benchmarking_Result__c.Challenges_with_M_E__c}'.
Here is the controller
On the VF page.
![User-added image](/forums/servlet/rtaImage?eid=906F0000000B76h&feoid=Body&refid=0EMF0000000QqLi)
Conversion Error setting value 'Its complicated' for '#{Benchmarking_Result__c.Challenges_with_M_E__c}'.
Here is the controller
Public ApexPages.StandardController stdcontroller; List<SelectOption> Commprefvalue = new List<SelectOption>(); public List<Selectoption> getCommpref() { Schema.DescribeFieldResult CommprefField = Schema.sObjectType.Benchmarking_Result__c.fields.Challenges_with_M_E__c; Schema.PicklistEntry [] Commpref = CommprefField.getPickListValues(); //Schema.PicklistEntry [] values = vendorField.getPickListValues(); for(Schema.PicklistEntry val : Commpref) { Commprefvalue.add(new SelectOption(val.getValue(), val.getLabel())); } return Commprefvalue; } //Save button public PageReference MAndEDevSaveBtn(){ stdcontroller.save(); PageReference callNextPage= Page.CSI_Positioning_And_Governence; callNextPage.setRedirect(true); return callNextPage; }
On the VF page.
<apex:selectCheckboxes value="{!Benchmarking_Result__c.Challenges_with_M_E__c}" layout="pageDirection"> <apex:selectoptions value="{!Commpref}"></apex:selectoptions> </apex:selectCheckboxes> <apex:commandButton value="Save and Continue" action="{!MAndEDevSaveBtn}" />The error
my extension
VF page
IT WORKS!!!!! :) :) :)
All Answers
my extension
VF page
IT WORKS!!!!! :) :) :)
Thanks in Advance...
The Visualforce page
The Test Class: Doesn't cover all the lines-> has 85% test coverage....You can add more test cases
Hope this helps!