How to figure out if the App is running in production?
I have a mendix app, running in the mendix cloud with three environments (test, acceptance, production). Is there a build-in function in mendix to figure out, if my app is running in production? I have a few functions in my app which should not be visible or executable in production (e.g. my TestSuite). In the Studio Pro I have to set the visibility of my TestSuite-Page to false if my app in running in production, but to true if the app is running in test or acceptance. Is there a build-in function in mendix for that or do I have to create a constant for it?
There is no built in function in the Mendix platform to regulate visibility or accessibility for based on environment.
What you could do for webapps:
In you microflow you could do a check on your application URL. Based on the URL, which is specific to your environment, you can let certain different logic happen conditionally. You can do this by using the Get application URL action from Community Commons.
Alternatively you can use your suggested constant.
good to know, thanks for the info.
Community Commons has a Java Action IsInDevelopment that returns true if the environment is a development environment.
Your suggestion of a constant is a good one, and something you’d have more control over.