Custom Link Best Practices
Custom buttons and links can streamline actions within Salesforce, or integrate Salesforce data with external URLs, applications, or systems. Use these tips to get the most out of your custom links.
Required Editions
| Available in: Salesforce Classic |
Custom buttons and links are available in: All Editions Visualforce pages and s-controls are available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions |
Field Names
Salesforce has no plans to change field names; however, that doesn’t guarantee that field names won’t change in the future. Therefore, custom links that include Salesforce fields could change how they’re mapped.
Pass Session IDs with SSL
Never pass session IDs to an http URL. Instead, pass session IDs with a secure sockets layer (SSL) https URL. Always use SSL for any data that is passed to other applications hosted on the Internet since the URL could contain sensitive customer information.
Single Sign-On
Use custom links to pass a session ID to support Single Sign-On (SSO), so users can
avoid multiple logins to web applications that your organization hosts to manage
Salesforce data. Construct your custom link to pass the {!User_Session_ID} merge field, which allows users to access all
authorized resources during a single authentication. External systems can access
Salesforce resources using a web service, which allows organizations to communicate
data without intimate knowledge of each other's IT systems behind a firewall.
Send the Server Date in the URL
Some integration projects need custom links to include a server date to know the Salesforce initiation date. The Salesforce server date can be passed to external systems using custom links. For example, http://someurl.com/somepath?current_date={!Today}. Dates use the Pacific time zone.
Avoid Double Sets of Tabs in a Browser
Unlimited Edition and Enterprise Edition users can build a custom link to perform an
action that keeps users in the same browser window and doesn’t display a double set
of tabs. Create a Visualforce page that contains the following code, replacing
<REGULAR_WIL> with your regular or
existing custom link.
<script language="JavaScript">
function redirect() {
parent.frames.location.replace("<REGULAR_WIL>")
}
redirect();
</script>
