Last active
February 9, 2020 16:57
-
-
Save Nahumancer/e0b40b4fa24e65f6714edd31132a9198 to your computer and use it in GitHub Desktop.
Salesforce Apex: Check if the current ORG is a Sandbox. / Required: Summer '14 (version 31.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To be used like: | |
// if (OrgUtilities.runningInASandbox()) { etc.. } | |
public class OrgUtilities { | |
public static Boolean runningInASandbox { | |
get { | |
if (runningInASandbox == null) { | |
runningInASandbox = [SELECT IsSandbox FROM Organization LIMIT 1].IsSandbox; | |
} | |
return runningInASandbox; | |
} | |
set; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment