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
BGrimesBGrimes 

Set value in dependant picklist via API?

Hi -

I'm trying to set the value of a dependent picklist to a valid value and nothing is happening.  The parent picklist is of the correct value to allow this to happen in the UI, but via the API nothing is set.  Can this even be done?

Many thanks!
Bryan
RickyGRickyG
Bryan -

Picklists values are not enforced through the API.  Now, I have just completed creating a solution that uses separate custom objects with a relationship to emulate the functionality of dependent picklists.  Would this be a help?

Note: The solution uses Visualforce Pages, which are not production at this time.

Hope this helps.

BGrimesBGrimes
Rick, thanks for the reply. 

I'm not sure emulating the dependent picklists will do me much good right now, but when we're writing apps with Visualforce it'll come in handy. :)

My issue here is that I can/have set field values via the API hundreds of times.  However, I've never had to set a dependent picklist value, and in this case it's failing.  In order to not post .NET code in this forum I'll refrain from posting the ins and outs, but the case is that when I set something similar to:

sfOppty.Fields("I_AM_A CUSTOM_DEPENDENT_FIELD___c") = "ABCD"

the object update will be fine, however, the field isn't touched with the rest of the updates.