Determining the enviroment and using this information

Some background:

We have a requirement that we must be able to navigate (using a link) to sharepoint from our application.

This would be no problem if we only had the one environment as we could simply hardcode the link to sharepoint in the URL of the External site.

However, we publish our application to a few different enviroments and we need to be able to determine from our application the enviroment we are in as each environment will have a different link to sharepoint.

Is there a way to determine the environment we are using in order to dynamically set up/overwrite an External Site URL or site property that could be used to hold a URL?

Any help would be greatly appreciated. Thanks.

whenever applications have configurations which are constant or don't change very often, developers can define site properties. Site properties allow developers to configure these values without having to change their applications, only changing the site property value (which can be done on the Service Center).
After changing site properties values, the application must be redeployed in order to refresh the site properties (which are stored on the cache of the Hub Node).

In your particular situation, you would have to create a site property which would define the sharepoint URL. Then, for each application environment (development, tests and production) you have to change the URL to the correct value.

Please, read more about site properties in the help chapter "About site properties".

Hope this helps.

Best regards