You need to sign in to do that
Don't have an account?

How to populate relative VF page link into URL custom field
Hi Guys,
Supposing I created a custom field with URL type on any object, I need to set the default value which navigates to a VF page.
What I populate is i.e. '/apex/helloworld'. But when the link is clicked on detail page, it takes me to a new place http://apex/helloworld which is not existing.
Does anybody know how to insert relative instance name before the '/apex/helloworld', such as global variables?
Regards,
Atlantis
Rather than hardcoding the server instance, you can determine it from the $API field:
All Answers
In my opinon, you can not give a reference of the page url in default value. You can keep default value as a blank and after giving the value of url field https://ap1.salesforce.com/apex/helloworld it will take you to the helloworld page.
You can also use formula field instead of url type field and use the syntax provided below :
HYPERLINK("https://ap1.salesforce.com/apex/helloworld" ,'testlink')
Hope this helps.
Thanks Pradeep.
In my case, i have to choose the first option as you said.
However, the real instance server name is not what i expected, because we need to migrate this to another environment.
Can I use placeholder instead of the real instance name i.e. ap1.salesforce.com?
Regards,
Atlantis
Rather than hardcoding the server instance, you can determine it from the $API field:
That is fantastic, Bob.