Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Extend Salesforce with Clicks, Not Code
Custom Link Best Practices

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

Note
Note Salesforce checks the correctness of URLs in custom links and custom buttons. When you create or edit custom links or buttons that contain invalid URL markup, such as scripts, Salesforce blocks the links from rendering. Instead, an error message is shown on hover. Reconfigure the URLs to be valid and well formed. The URL can be a relative URL or an absolute http://, https://, file://, ftp://, or mailto:// address. Invalid URLs in custom links or custom buttons created before Spring ’13 aren’t checked for correctness until you edit them.

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>
 
Loading
Salesforce Help | Article