I've marked multiple Case Status picklist values as "Closed", and now I want to access only those picklist values which are marked as Closed in Apex class. I tried looking for this in documentation but could not find any thing.

I need to find "picklist" values which are marked here as Closed

1 Answer 1



You need to query a standard salesforce object CaseStatus:

This object represents a value in the case status picklist. Query the CaseStatus object to retrieve the set of values in the case status picklist.

Select Id, MasterLabel From CaseStatus Where IsClosed = true

You nees to use this field "Status" in your SOQL query:

List<Case> cases = [select Id from case where status='Closed'];
System.debug('#### cases: ' + cases);

  • No that will not work. I don't need Cases list but need list of Picklist Values that have been marked as 'Closed' as shown in this screenshot: screencast.com/t/W0GroPoih
    – VarunC
    Jan 20, 2014 at 16:01
  • @VarunChaddha Ahh, got you now. Updated my answer. Jan 20, 2014 at 16:32
  • thnx a bunch :-) ...
    – VarunC
    Jan 20, 2014 at 16:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .