You need to sign in to do that
Don't have an account?

Dependent picklists in visualforce using apex ??
Hi All
Is there any solution to implement dependent picklists in visualforce using apex?
I know an alternate solution to hack picklist.js of salesforce and can implement dependent picklist functionality. But I want to confirm again that is there any idea to implement this same functionality using visualforce & apex without hacking javascript? I tried with DescribeSObject to get dependent picklist values, but could not able to get their Field Dependency relationships.
Thanks :smileyhappy:
Is there any solution to implement dependent picklists in visualforce using apex?
I know an alternate solution to hack picklist.js of salesforce and can implement dependent picklist functionality. But I want to confirm again that is there any idea to implement this same functionality using visualforce & apex without hacking javascript? I tried with DescribeSObject to get dependent picklist values, but could not able to get their Field Dependency relationships.
Thanks :smileyhappy:
Thank for the reply but I already know implementation of dependent picklist with apex get/set property and ajax. But here my concern is that for this dependency I have to used hard code field dependency relationship that I do not want. I want a way to find out these field dependency relationship in apex. Means what values of child field depends on which value of parent field? I hope you understand my concern here.
Please let me know if you have any idea.
Thanks
All Answers
Do you want to control the dependency through the standard field setup / customizaton or through your apex controller? You could create an implementation that uses an actionfunction on the first picklist that then re-writes the potential values in the dependent picklist and refreshes that portion of the page. (The dependent picklist would need to be a custom field pointing to a custom getter / setter in your controller and you may need to make some changes in your save method or in the setter that transfers the data from this custom field to a field on your object.)
This isn't fully thought-out, but if something like that will work, let me know and I can provide some more detail / code.
-- Matt
Unfortunately, no good way to do this today, any solution is a "hack".
Make sure you all vote for this idea on the Idea exchange!!
http://ideas.salesforce.com/article/show/10092833/Support_Dependent_Picklists_in_Visualforce
Thank for the reply but I already know implementation of dependent picklist with apex get/set property and ajax. But here my concern is that for this dependency I have to used hard code field dependency relationship that I do not want. I want a way to find out these field dependency relationship in apex. Means what values of child field depends on which value of parent field? I hope you understand my concern here.
Please let me know if you have any idea.
Thanks
Hey ,
Did you get a solution for the above ?. Please share ua knowledge, greatly appreciate if someone come up with a sample code and explanation. Though it might take some time out of ua plate but would be appease many appetite still in hunt of it.
thanks
Depending on the timing of your project, you may want to consider waiting. According to the release notes, the Summer '10 release will have native support for this (Finally!!).
http://na1.salesforce.com/help/doc/en/salesforce_summer10_release_notes.pdf
http://infallibletechie.blogspot.in/2012/10/dependent-picklist-using-apex-in.html
Check this link.
Regards,
Magulan D
Salesforce.com certified Force.com Developer.
SFDC Blog
If this post is your solution, kindly mark this as the solution.