How I can Find Environment Name (Devolopment-Test-Production)

Hello Everyone,

I am trying to write Environment Name (Dev-Test-Prod) on the main page of mobile application.

When i open my application. I must understand which environment i am using?

I am trying to understand with HTTPRequestHandler.GetRequestDomain.Is there any different way?



Thank You


Best Regards



Solution

We use GetServerName() from RichWidgets.

Solution

I have changed thank you.

You're welcome :)

Hello Kilian,

I did not understand why it does not work. it depends on server and client side ?

Hi Ahmet,

GetServerName() is also a Function, so you can use iit directly in an Assignment or Expression (no need to call it as an Action, though you can, if you prefer). That said, I'm not sure what you're debugging. "OutEnvironmentName" is presumably a Local Variable, but do you assign it the output of GetServerName? If you step over GetServerName, what does the debugger show its output is?

Does get ServerName()  work on personal environments?

when I used this in an EMAIL context in a PROCESS... it returned "127.0.0.1"

This is not helpful.

Any alternative?  This seems to only work when the context is WEB

Randy Weaver wrote:

when I used this in an EMAIL context in a PROCESS... it returned "127.0.0.1"

This is not helpful.

Any alternative?  This seems to only work when the context is WEB

Yes, correct, that's because when an email is running, it's actually called by a Windows process that calls a Web Service at localhost, so there is no host header being sent with the request.

What are you trying to do in the email? That will determine the right approach here.

J.Ja

I would assume something like add something to the subject or change the sender, so that it's clear it's not from production? (We use site-properties for that.)