704
Views
15
Comments
Solved
How to get the current environment domain URL when running a Timer?
Application Type
Reactive

Hi,

When using GetRequestDomain server action  from the HTTPRequestHandler module, it's possible to get the current environment domain at runtime. However, when running a Timer, GetRequestDomain does not return similar results.

Is there any built-in function that can get the domain when running a Timer?

If there's no built-in function, please suggest an alternative solution, preferably without using Forge components.

Thankyou!

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

You can get the current domain name by querying the Parameter entity from System with a filter set to Parameter.Name = "DefaultDnsName"

This will return the domain name only like "myenvironment.outsystemscloud.com" or any custom defined domain name e.g. your load balancers dns domain name.

Stefan

2023-11-22 10-51-50
Jozy Sohail

Hi @Stefan Weber ,

I just checked what you said and i found my domain name under DefaultDnsName.

Is this correct?

Reagrds,
Jozy Sohail

2021-10-09 07-57-44
Stefan Weber
 
MVP

Yes. Sorry for the wrong parameter name. DefaultDnsName is correct.

2023-11-22 10-51-50
Jozy Sohail

Hi @NGUYEN DUC THOAN ,

Have a look what Stefan Weber said,

Hope it helps.

UserImage.jpg
NGUYEN DUC THOAN

Hi @Stefan Weber ,

Thank you for sharing. The solution you provided helped me get the current domain name. Additionally, do you know of any other solutions aside from directly referencing the database? 

I haven't seen anyone mention built-in functions. It seems like there are no built-in functions currently that can solve this issue, right? 

2021-10-09 07-57-44
Stefan Weber
 
MVP

Not as far as i know. As the dns name typically doesn't change you can set a high caching value on the aggregate where you retrieve the parameter to prevent multiple database roundtrips.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
UserImage.jpg
NGUYEN DUC THOAN

Hi @Stefan Weber ,
I understand. I have solved my problem, so I will mark your answer as the solution. 

Regards,

Thoan

2022-03-03 22-15-30
Borislav Shumarov PhD
Champion

Greetings @Stefan Weber and the rest!

This will return the domain name only like "myenvironment.outsystemscloud.com" or any custom defined domain name e.g. your load balancers dns domain name.

<-  in case of a load balancer, where can we set this to return our new Load Balancer-provided address? Is it the Environment Hostname in Service Center or we have to change something else?

The documentation I found on load balancers is quite abstract on such topics..

UserImage.jpg
NGUYEN DUC THOAN

Hi @Jozy Sohail ,

Thanks for sharing.

I have read this article, and the solution proposed is to use site property. Is there any other solution available?

2023-11-22 10-51-50
Jozy Sohail

Sure Nyugen,

Will check and get back to you if I find a solution.

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

You can get the current domain name by querying the Parameter entity from System with a filter set to Parameter.Name = "DefaultDnsName"

This will return the domain name only like "myenvironment.outsystemscloud.com" or any custom defined domain name e.g. your load balancers dns domain name.

Stefan

2023-11-22 10-51-50
Jozy Sohail

Hi @Stefan Weber ,

I just checked what you said and i found my domain name under DefaultDnsName.

Is this correct?

Reagrds,
Jozy Sohail

2021-10-09 07-57-44
Stefan Weber
 
MVP

Yes. Sorry for the wrong parameter name. DefaultDnsName is correct.

2023-11-22 10-51-50
Jozy Sohail

Hi @NGUYEN DUC THOAN ,

Have a look what Stefan Weber said,

Hope it helps.

UserImage.jpg
NGUYEN DUC THOAN

Hi @Stefan Weber ,

Thank you for sharing. The solution you provided helped me get the current domain name. Additionally, do you know of any other solutions aside from directly referencing the database? 

I haven't seen anyone mention built-in functions. It seems like there are no built-in functions currently that can solve this issue, right? 

2021-10-09 07-57-44
Stefan Weber
 
MVP

Not as far as i know. As the dns name typically doesn't change you can set a high caching value on the aggregate where you retrieve the parameter to prevent multiple database roundtrips.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
UserImage.jpg
NGUYEN DUC THOAN

Hi @Stefan Weber ,
I understand. I have solved my problem, so I will mark your answer as the solution. 

Regards,

Thoan

2022-03-03 22-15-30
Borislav Shumarov PhD
Champion

Greetings @Stefan Weber and the rest!

This will return the domain name only like "myenvironment.outsystemscloud.com" or any custom defined domain name e.g. your load balancers dns domain name.

<-  in case of a load balancer, where can we set this to return our new Load Balancer-provided address? Is it the Environment Hostname in Service Center or we have to change something else?

The documentation I found on load balancers is quite abstract on such topics..

2023-04-17 05-19-55
Vaishali Shrivastava
UserImage.jpg
NGUYEN DUC THOAN

Hi @Vaishali Shrivastava ,

I have checked the post that you shared. The solution there is similar to the one Stefan Weber mentioned above. Thank you! 

2025-09-02 13-37-45
Ricardo Monteiro

Hi everyone, I’ve put together a forge component that I think might just be the answer to this issue.

https://www.outsystems.com/forge/component-overview/22949/environment-info-o11

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