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
Shohrat MuhamovShohrat Muhamov 

Create field dependency in visualforce page

Is it possible to create field dependency in Visualforce page for two unrelated picklists from different objects without hardcoding in custom controller? (with javascript or any other alternative)
DevADSDevADS
Hi Shohrat,

1.You can use Custom setting/ Custom Metadata Type to store your dependent picklist structure. 
2.Create an Apex class and create Map<String, List<String>> to hold the master-options record.
3.Use this map in populating the picklist values onChange of the master picklist using apex:actionsupport

Do post here if you have any further questions.
Happy Coding!
Shohrat MuhamovShohrat Muhamov
Hi,

I am trying to solve this problem without involving Apex. Is there any way of doing it on Visualforce page side with javascript?

Thank you.