You need to sign in to do that
Don't have an account?
narsavagep
Testing for Sandbox Environment?
Is there a way for the code to know whether or not it is running in a production instance, or a sandbox?
I have scheduled APEX that sends an email to specific email addresses three times a day. Whenever someone makes a new sandbox in our company, that sandbox starts sending the emails and I have to manually go into every sandbox when it is created and remove the scheduled APEX. I want the function to be smart enough to know that it is running with a sandbox environment, and therefore not send the email.
Any ideas?
Thanks!
Paul
After some research and looking at the "Ideas" board... I found a solution.
Hope this may help someone else out there with similar question.
Paul
All Answers
After some research and looking at the "Ideas" board... I found a solution.
Hope this may help someone else out there with similar question.
Paul
I have posted a more generic solution for this on my blog: http://www.michaelforce.org/recipeView?id=a0Ga000000Ekp65EAB
By "generic" I mean it is good if you plan to share the code with multiple orgs through packaging... using my class will work no matter where you are!
Hope this helps anyone finding this thread through search!