+ Start a Discussion
amitashtekaramitashtekar 

Populating controlled picklist values based on selection of controller picklist within apex.

Hi All,

 

 

I want to show controlled picklist values based on selection of controller picklist within apex.

 

I have not provided any CRUD rights on the specific object to the profile.

 

Does any one have any idea about it.

 

 

Thank you.

 

 

Regards,

Amit

Navatar_DbSupNavatar_DbSup

Hi,

 

If your CRUD property for a object in a profile is not enable then you can’t access the object and its fields in apex.

 

On the other hand if the CRUD property is enable then you need to create two picklists in the object, now create dependencies between them. In the last you can now add these picklists in you page using <apex:inputField> tag.

 

Other way to do this is by creating these picklists dynamically by using JavaScript.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

amitashtekaramitashtekar

Thank for reply.

 

I do not want to bind the field with page. I want to do it apex.

 

For some reason I can not provide CRUD rights on the custom object to the user having specific profile.

Still i want to populate controlled picklist values based on selection of controller picklist values.

 

Is there any other way, like schema methods to populate dependent picklist values?