Skip to content

Instantly share code, notes, and snippets.

@conrjac
Created June 11, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conrjac/1d1db5abbd085bd7e73e52ac0da8de23 to your computer and use it in GitHub Desktop.
Save conrjac/1d1db5abbd085bd7e73e52ac0da8de23 to your computer and use it in GitHub Desktop.
SOQL Query to determine if your org is a sandbox
Organization currentOrg = [SELECT Id, IsSandbox, Name FROM Organization LIMIT 1];
If(currentOrg.IsSandbox == True)
{
System.Debug('Your in a sandbox!');
}
SELECT Id, IsSandbox, Name FROM Organization LIMIT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment