I am setting up a result process based on batches and just wondered if there is a way to identify if the batch is run from the Production or Testing environment.
Asked
Active
Viewed 583 times
2
-
Have a look here http://salesforce.stackexchange.com/questions/50/can-we-determine-if-the-salesforce-instance-is-production-org-or-a-sandbox-org – Avidev9 Dec 04 '13 at 15:52
-
3If your results are sent via email then the subject will start with "Sandbox: " when sent from a sandbox and wont have it in production. – BarCotter Dec 04 '13 at 17:36
1 Answers
2
The answer @BarCotter posted above in the comments is the simplest way to know, which is that your Sandbox emails will be prefixed with "Sandbox: " in the Subject line out of the box. In fact, you can't even turn this off (as seen here)
I found the same question posted on StackOverflow that gives some additional options around retrieving the URL of your Salesforce org and letting you work with that. However, based on your question, working this these are probably outside the scope of what you really want to do.
https://stackoverflow.com/questions/1507718/how-do-i-detect-the-environment-in-salesforce
Michael Welburn
- 5,836
- 2
- 33
- 73