Would like to detect which Salesforce Edition my Apex classes are running. I've been pouring over the documentation but so far haven't found the right class and method to retrieve this as a string.

Any thoughts?

1 Answer 1


Query the OrganizationType field from the Organization object.

Organization org = [select OrganizationType from Organization];

Unlike most queries, you can assume that exactly one record exists for this query.

This field appears to be a pick list, so you can describe it to see all possible values.

  • Thank you - just what I was looking for! Jan 24 at 23:19

You must log in to answer this question.

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