We have integrated sfdc with a document management sytem and a erp system. We have integrated this via a portal solution.
We want to make sure that when a full copy is done from production to for instance the training sandbox dat training (integration) data is NOT placed in our integrated production environment!
Therefore I want to know in an apex class in which sfdc sandbox (or production) the apex class is running. For now I use the Userinfo.getUsername() call to determine the sandbox because the sandbox name should be placed behind the email adress.
Is this a solid method? Is there anothe api call which i can do to retrieve the current contex?
I am also interested in experiences on how to configure test/acceptance/production in integrated environments where SFDC is one of the systems