3437
Views
9
Comments
Solved
How I can Find Environment Name (Devolopment-Test-Production)
Question

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



2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

We use GetServerName() from RichWidgets.

2018-11-14 10-40-45
ahmet yaman

I have changed thank you.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You're welcome :)

2018-11-14 10-40-45
ahmet yaman

Hello Kilian,

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

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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?

UserImage.jpg
Paul Davies

Does get ServerName()  work on personal environments?

UserImage.jpg
Randy Weaver

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

2019-11-12 17-31-26
Justin James
 
MVP

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

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.