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
aj4aj4 

API Help -- Dependent Picklist

I am trying to get dependent picklist values through API. I have product category as controlling field and product as dependent field. I want to get dependent picklist whenever controlling value is change. My parameter is Conrolling field value.
 
Can Any one from Salesforce will help me in resolving this issue. Is there any API available?
SuperfellSuperfell
describeSObject includes information about dependent picklists values.
aj4aj4
How to get bitset value for Controlling field? I have controlling field value and I want to get dependent list for this .
SuperfellSuperfell
The PicklistValue objects on the controller field has the bitset of applicable controllee values for each controller picklist value.
aj4aj4

Is there any way to get bitset value for Controlling field.

Example : I have 'HRO' is controller field Value and I want to get relate picklist for this value. How to get bitset value for HRO.

 

public List getRelatedList( Field field,Field controller) throws KPSCDynamicReportsException {

 

List relatedList = new ArrayList();

PicklistEntry[] picklistValues = field.getPicklistValues();// this is the dependent list

/// I wnat to filter this  picklistValues depends on controller field value which is also picklist

relatedList  = ///

 

return relatedList

}

 

 

SuperfellSuperfell
I don't follow what you're asking for, the controlling field has a bitset for each value of the controlling picklist. Have you read the section in the docs ?
aj4aj4
Simon,
 
Do you have Samlple code to get related list for the controlling values.
 
Example: parameter is  controlling field value.
 
List getRelated list( String conrollingFieldValue){
 
 
return dependentList
}
SuperfellSuperfell
not off the top of my head, there's sample code for this in javascript i posted a few weeks ago.