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!
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
Hi @Stefan Weber ,
I just checked what you said and i found my domain name under DefaultDnsName.
Is this correct?
Reagrds,Jozy Sohail
Yes. Sorry for the wrong parameter name. DefaultDnsName is correct.
Hi @NGUYEN DUC THOAN ,
Have a look what Stefan Weber said,
Hope it helps.
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?
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.
This is a useless reply
Hi @Stefan Weber ,I understand. I have solved my problem, so I will mark your answer as the solution.
Regards,
Thoan
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..
Hi Nguyen,
have a look at this post,
https://www.outsystems.com/forums/discussion/92581/how-to-get-environment-url-using-getrequestdomain-in-timer/
Hope it helps,
Thanks
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?
Sure Nyugen,
Will check and get back to you if I find a solution.
Hi @NGUYEN DUC THOAN,
Please refer to this post https://www.outsystems.com/forums/discussion/66626/getservername-not-working/
Hope this will help you!
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!
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