GetBookmarkableURL returns localhost instead of current server

GetBookmarkableURL returns localhost instead of current server

  

I am using OutSystems 10 and running tests on a dev environment and I'm getting strange behavior from the GetBookmarkableURL function. I am using it to get the base URL of the site to dynamically generate a link. Sometimes, but not always, it gives me back the URL as "https://127.0.0.1/..." and then other times it will give me what I'm expecting which is something more like "https://dev.companyname.com/...".

I have no idea what I could be doing to cause this as the same code gives different results all while on the same environment. Is there some quirky thing about GetBookmarkableURL that I need to be aware of?

My code looks like the following: 

Substr(GetBookmarkableURL(),0, Index(GetBookmarkableURL(), GetPageName(),startIndex:,searchFromEnd:,ignoreCase:))

I got this code from this idea thread.

Solution

Hello Trevor,

I believe GetBookmarkableURL uses the server on the request to build the URL. That means that, if you access the page on the browser using 127.0.0.1 or dev.companyname.com, you'll get the different results you mention.

Cheers,
R

Solution

I was attempting to follow the very same post from the idea thread and I get this issue as well. I'm accessing my on-premise site through a friendly url and the function is giving me http://127.0.0.1/SiteName/PageName.aspx

Anyway to fix this? I'm using service studio 9 if it's relevant.