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
Sameer_NicknameSameer_Nickname 

Setting dependent picklist values using java

Hi

 

 I tried exploring metadata API but found that we can only read dependent picklists values where dependency is already set by admin.But if we want to set dependency( include new values in dependent picklists) using Salesforce API programatically through java code .Is is possible? Please throw some light on how to do it...

 

Thanks and Regards

-Sameer Gijare

sfdcfoxsfdcfox

You should be able to specify controlling values with the Metadata API; the Picklist object has an attribute called controllingField that is the API name of the controlling field, and each PicklistValue has an array that describes the valid controlling field values for that given value. Please take a look at the documentation for full details. As an example, you could export an existing dependency to determine how this is created in XML.