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
SS KarthickSS Karthick 

Get lists of dependent picklist options in Apex

Hi folks,
    Can anyone tell me how to get the list of dependent picklist options in apex?

My usecase is:
I have a pair of dependent picklists. In Apex code, how can I determine what options are valid in the dependent field for each option in the controlling field?

I’ve tried using getPicklistValues(), but there doesn’t seem to be any way of getting dependency information.



Thanks in advance
Karthick
Best Answer chosen by SS Karthick
Karamala DamodarKaramala Damodar
hello karthik if u want to track about object of fields u must use two ways that is 
1.tokens
2.schema methods

i schema methods use schema.describefieldresults and schema.describeobjectresults

All Answers

lakslaks
Hi Karthik,

Haven't tried it. But maybe the info here might be of help ->
http://salesforce.stackexchange.com/questions/4462/get-lists-of-dependent-picklist-options-in-apex


Regards,
Lakshmi.
Karamala DamodarKaramala Damodar
hello karthik if u want to track about object of fields u must use two ways that is 
1.tokens
2.schema methods

i schema methods use schema.describefieldresults and schema.describeobjectresults
This was selected as the best answer