+ Start a Discussion

Setting dependent picklist values using java



 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


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.