Validation Error: value is not valid error in Salesforce

This error may be due to assigning Set data type variable to <apex:selectOptions/>.

The workaround for this is, assign the Set data type values to List data type variable and assign it to the <apex:selectOptions/>.

Sample Controller:

Set<SelectOption> optionsSet = new Set<SelectOption>();
List<SelectOption> optionsList = new List<SelectOption>();

        optionsSet.add(........, '...........');

Sample VF Page:

        <apex:selectOptions values="{!optionsList}"/>


Happy Coding!!!

1 comment:

  1. The issue seems to be with something else. I am using the list, but its not helping at al.