You need to sign in to do that
Don't have an account?
eliotstock2
determining the enviornment at runtime
Hi there.
I have a situation where I want to behave differently in Prod to the Sandbox. Is there anyway to tell programmatically which environment I'm executing in?
Thanks,
Eliot Stock.
As a best practice, code should not be dependent on the environment you are running in. Orgs will change from time to time behind the scenes (e.g., you may find one day that your prod instance is no longer on na1 but is on na6). There are many different ways to do common tasks without making it org-specific. What are you trying to do?
If you absolutely need to you could use {!$CurrentPage.Url} in a Visualforce page and extract the domain name.