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
chadwtaylorchadwtaylor 

Retrieve list of Case Type (picklist)

I need to use SOQL to retrieve a list of CASE TYPE (picklist) under CASE.

 

Any tips on how to do this will be greatly appreciated.

chadwtaylorchadwtaylor

I was able to get the list of picklist values under object Case using this "databasedotcom" gem (for Rails developers).

 

Sample usage:

 

> c = client.materialize("Case") 

  => Case 

 

> c.picklist_values("Type") 

  => [{"value"=>"Problem", "active"=>true, "label"=>"Problem", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Feature Request", "active"=>true, "label"=>"Feature Request", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Question", "active"=>true, "label"=>"Question", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"RMA Request", "active"=>true, "label"=>"RMA Request", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Site Access Request", "active"=>true, "label"=>"Site Access Request", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Sales Query", "active"=>true, "label"=>"Sales Query", "defaultValue"=>false, "validFor"=>nil}] 

MandyKoolMandyKool

Hi,

 

You can use following blog to retrieve picklist values dynamically using Apex.

 

http://blogs.developerforce.com/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html