function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mack DsozaMack Dsoza 

get Picklist value

I want it that I have one picklist field & I want its selected value on controller as String format so how can I do this ?

I have created bean for it also but this field is custom field of my custom bject Income__c & there are lots of field & I can't create getter setter method for each field so that i created bean for entire object so that its field value will also be acceessible but the problem is that how to access this field value also..

I tried this also

 

String name = beanInstance.Income__c.Income_class__c.value;

String name = beanInstance.Income__c.Income_class__c;

 

But both are not working in my controller....

Please reply soon..

Regards...

Kevin BromerKevin Bromer

You'd need to post the rest of your controller code, but if you're not querying via SOQL for the field value in your wrapper class/bean, you won't be able to access the field.   (Assuming your object Income__c is publicly exposed as a property of the bean)

 

string name = beanInstance.Income__c.Income_Class__c; is the right way to query for it.