function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AaronLauAaronLau 

How to get server url while using the hyperlink custom field?

I want to create a hyperlink custom field used to integrate another application with salesforce. The reason I want to use a custom field, instead of a custom link, is: custom field supports adding image to it. The problem I have is: I found it only has a function to get session id "GETSESSION()", but it does not have any function to get server url which is also required to authenticate a user. anyone can help me on how to get the server url while using the hyperlink custom field?
 
thanks,
ClaiborneClaiborne

In your custom link, specify the location and sessionId has "get" variables. When you build the link, look for the API fields. Be sure to include the proper location for your application. There are different locations for the partner and enterprise versions, and there are a couple of old api versions supported.

Your custom link should look something like this:

https://yourwebsite.com/yourwebpage.html?sessionId={!API_Session_ID}&location={!API_Partner_Server_URL_70}&whatever other variables you want to pass.

BlobBlob

I'm looking for the same information.

How can I pass the Partner Server URL and the Enterprise Server URL on a HYPERLINK?

I would prefer not to hard code the URL.

Note that the question is about the HYPERLINK, NOT the custom link. Getting them on the custom link is easy, but the custom link cannot always be used.

ClaiborneClaiborne
I do not think there is a way to do it with a hyperlink field. One alternative is to create a formula as a text field. This technique is often used to create buttons, and you can even map in an image to make it look like a button. The MapQuest AppExchange uses this to create a field like:
 
HYPERLINK("/servlet/servlet.Integration?lid=01N600000008nKe&accountId="&Id ,
IMAGE("/servlet/servlet.ImageServer?oid=00D300000006Dv6&id=01560000000FRAQ", "Click to Map"))
 
Note that oid and id are unique to your organization.
 
The problem with this is that the API fields are not available selections for formulas.
 
-- NOTE TO SELF: Add "wish" request to provide API fields to all formula fields --
 
With the Winter '07 release, you can create custom buttons which appear at the top and bottom of the displayed information. These buttons can include API fields.Maybe this will help.
AaronLauAaronLau
one solution to this problem is: first create a custom link which has both session id and server url, then make the hyperlink field link to the custom link. so when the hyperlink field is clicked, it will go to the custom link first and then go the destination you set in the custom link