You need to sign in to do that
Don't have an account?
![gdk gdk](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Error for Selectoption: Constructor not defined: for number field
Hi,
Error: EnterMarks Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(Decimal, Decimal) at line 11 column 16
public List<selectOption> lstR = new List<selectOption>();
public List<selectOption> getNumber() {
lstR.add(new selectOption('---None---','---None---'));
for(Student_Information__c objR:[select Roll_Number__c from Student_Information__c ]){
lstR.add(new selectOption(objR.Roll_Number__c,objR.Roll_Number__c));
}
return lstR;
}
Please help.
Selectoptions are made up of a string value and string label, so you can't pass Decimal values in directly.
You can convert a decimal to a string using the toPlainString method - something like the underlined below should do the trick:
All Answers
Selectoptions are made up of a string value and string label, so you can't pass Decimal values in directly.
You can convert a decimal to a string using the toPlainString method - something like the underlined below should do the trick: