I wanna know the type of environment my salesforce org uses. I ran the following query:

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

It says the organization type is 'Enterprise Edition' but I want to know whether this sandbox is a 'developer sandbox' or 'developer pro' sandbox.

I have no information on how and when this sandbox was created and also 'Organization.Name' does not work for the query.

I have already gone through this https://salesforce.stackexchange.com/questions/110760/how-to-identify-the-type-of-sandbox-in-apex

but since I dont have any information on how the sandbox was created, I think I am not able to query Organization.Name in my query.

  • 2
    Possible duplicate of How to identify the type of Sandbox in Apex? Commented Sep 27, 2017 at 9:41
  • @TusharSharma I already have checked the post mentioned in the link, that's why I have put a comment that "I have no information on how and when this sandbox was created and also 'Organization.Name' does not work for the query.".
    – user905
    Commented Sep 27, 2017 at 9:42
  • Then you should mention this question in your post as reference otherwise this question will be closed shortly. Commented Sep 27, 2017 at 9:45
  • 1
    @TusharSharma: thanks for the comment. I have mentioned the same in my question.
    – user905
    Commented Sep 27, 2017 at 9:50

2 Answers 2


I think the easiest way might be go to Setup>Monitor>System Overview and see that amount of Data Storage available as that is different for each type of sandbox.

See the image - this is a bit of a simplistic way of doing it but it will allow you to recognise the sandbox type. So as I have 200mb of storage this is a Developer Sandbox.

System overview shot

  • Just trying to find how to retrieve this using SOQL for the Org's details.
    – Dave Humm
    Commented Sep 27, 2017 at 10:21

I don't think there's a straightforward way to obtain it with SOQL, in the sandbox itself. You could do a Tooling API callout to the production org and query the SandboxInfo table. It's not great because you'd need credentials for the production org (consider using "named credentials"?)

In the sandbox itself, again with a Tooling API callout you can get the limits, including storage usage & max available space. Combine it with info from https://help.salesforce.com/articleView?id=limits_sandbox.htm&type=0 and you're getting somewhere...

You must log in to answer this question.

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