I have a custom link on the opportunity object which points to an external site. Is it possible to add this custom link to a visualforce page?
The solution I came up with was to copy the url salesforce creates for this custom link, and paste it in the page. It looks something like this:
<a href="https://{!hostname}/servlet/servlet.Integration?lid=00bE0000000YbK3&eid={!opportunity.Id}&ic=1">my custom link</a>
This works fine, however, it won't work once it's in a managed package installed on other servers because the lid param will be different (the custom link id). Is there a solution for this?
To build off the answer from danieljimenez, the $Action
global variable provides access to the button/link objects. From there you need to use the URLFOR
function to get it into a usable form. Then you can either put it into the action
param of a command button, or use it as you'd like anywhere else in your markup.
<apex:commandButton action="{!URLFOR($Action.My_Obj__c.My_custom_link)}" value="My custom button"/>
or
<a href="{!URLFOR($Action.Calculation__c.My_custom_link)}">My link</a>