You need to sign in to do that
Don't have an account?
sanjeev342
How do I reference picklist values in a controller?
I'm trying to create a rule.
IF(value X is selected in picklist) -------> THEN( make sure List Y has at least one value)
How do you find the value of a picklist in a Controller Class?
Thanks,
Sanjeev
Are you trying to find all of the picklist values of a field?
You can do a Schema field describe
That will give you all of the values of a given picklist field. Try it in execute anonymous to see what it gives and reference this doc http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_fields_describe.htm
--KC
KC,
Thanks for the reply, what I'm trying to do is find out what value was selected so that I can run different code based on that value.
How do I go about doing this?
Thanks,
Sanjeev
You will need to bind the picklist field to a variable in the controller class using {gte;set;}.
This will make sure that the selected value for the picklist is available in the controller. Then depending on this value u can run the required peice of code.