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.


1 Answer 1


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.


You must log in to answer this question.

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