7

Using the Organization object we can differentiate between Production or Sandbox orgs using IsSandbox. Is there any programatic way to differentiate between a Developer Free Org vs a typical Production Org?

I see there is Organization.OrganizationType with following values, but it holds value as followings

  • Enterprise Edition (dev org created from partner portal)
  • Developer Edition (typical dev org)

Is there any easy and deterministic way to differentiate between Production and Developer Edition orgs?

8

The various values for Organization Type are:

  • Team Edition
  • Professional Edition
  • Enterprise Edition
  • Developer Edition
  • Personal Edition
  • Unlimited Edition
  • Contact Manager
  • Edition Base Edition

Here is a simple logic to tell whether the org is a true production or developer org.

  1. If the OrganizationType equal to Developer Edition, it is not production definitely.
  2. If the OrganizationType equal to Enterprise Edition OR Unlimited Edition Professional Edition and has TrialExpirationDate, then it is not production.
  3. Organization.IsSandbox = True, then it is not production, but a sandbox org.

We can find this using the following query:

SELECT
  Id, Name, InstanceName, IsSandbox, OrganizationType, TrialExpirationDate
FROM Organization

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.