Assuming we select for each picklist value a specific color (ie not dynamic assignment) how to query the hexadecimal color value in Apex/soql ?

  • 1
    I haven't found any API or table through which to retrieve colour assignments for picklist values. I'll be interested to see if someone else has...
    – Phil W
    Apr 21 at 10:09
  • Is your choice of colors already defined? Where are you using this picklist, as a field on the object?
    – CyberJus
    Apr 21 at 13:21
  • @CyberJus. yes each picklist value has a color. we want to use the color value as a filter in a custom component. since we can not add new attributes in the picklist, option is either add a prefix/suffix in the api name or label name . but for other reasons , we want to avoid this. thus i was trying to see if you could use the color as a filter if i am able to query it.
    – P infor
    Apr 22 at 11:06

The Metadata API looks like it has access to the charting color property of picklist values.

You would need to access the CustomValue metadata type.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.