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
arun57arun57 

Apex code for dependent picklist values for around 250 picklist values

Hi i have a 5 dependent picklist values say as Ford, toyota, honda, benz, audi.

Ford has 30 picklist values.
toyota has 60 picklist values.
Honda has 100 picklist values
benz has 250 picklist values.
audi has 80 picklist values.

Suppose 1st value of  Ford  picklist value is selected  , i will get the revelant picklist values of Toyota. 
After that Depends up on Ford, Toyota values , another picklist has been selected from Benz. 

i will summarize this, if i select picklist of Ford, Honda values will come, after that benz values will come , after that depends of ford,toyota,honda,benz --the last values audi is automatically choosen..


Can anyone please tell me how to write this one on Lighing component ...and apex code as well.....please ping me i have around 1000 fields to pick automatically from one another
 
arun57arun57
Ford has 30 picklist values.
toyota has 60 picklist values.
Honda has 100 picklist values
benz has 250 picklist values.
audi has 80 picklist values


Toyota is dependent picklist value of Ford
Honda is dependent picklist value of Toyota
benz is dependent picklist value of Honda
Aundi is dependent picklist value of Benz


I have these picklist values in CSV file i have to make a lighing component and display this on lighting page... can any one help me with APEX Code with MAPPING 
Anilkumar KotaAnilkumar Kota
Hi Arun ,

Please find the below links will help for your requirement .

http://www.infallibletechie.com/2012/10/dependent-picklist-using-apex-in.html
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_dependent_picklists.htm
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Arun,  The code in this blog post (https://glyntalkssalesforce.blogspot.com/2018/08/dependent-picklist-values-in-apex.html) is about 30 lines of Apex that returns the valid dependent picklist values for every controlling value.  The post also includes test code.  I hope it helps you - or anyone else who navigates to this forum question.