Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Web Links entry
How-to guide

Create a URL Web Link that survives Lightning

Here is how to create a URL-based Web Link, the variety that works in both Classic and Lightning Experience. The steps are nearly identical for a button; you only change the display type.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated Jun 16, 2026

Here is how to create a URL-based Web Link, the variety that works in both Classic and Lightning Experience. The steps are nearly identical for a button; you only change the display type.

  1. Open the object in Setup

    Go to Setup, Object Manager, and pick the object (for example Account). Click Buttons, Links, and Actions, then New Button or Link.

  2. Set label, name, and display type

    Enter a Label and let the API Name auto-fill. Choose a display type: Detail Page Link, Detail Page Button, or List Button.

  3. Choose URL as the content source

    Set Behavior (for example Display in new window) and Content Source to URL. URL keeps the link working in Lightning Experience.

  4. Build the URL with merge fields

    Type the target address and insert merge fields from the picker, such as {!Account.Id} or {!Account.Name}, to pass record context.

  5. Save and add it to the layout

    Click Save, then open the relevant Page Layout (or related list) and drag the new link or button into place so users can see it.

Mandatory fields
Labelrequired

The user-facing text for the link or button.

Name (API Name)required

The unique developer name; auto-generated from the label and used in metadata.

Display Typerequired

Detail Page Link, Detail Page Button, or List Button.

Content Sourcerequired

URL, OnClick JavaScript (Classic only), or Visualforce Page.

Behaviorrequired

How the target opens, such as a new window or the existing window with or without the sidebar.

Gotchas
  • A new link is invisible until you add it to a page layout or related list; creating it is only half the job.
  • OnClick JavaScript links do not appear in Lightning Experience at all, so never use that content source for a Lightning org.
  • URL parameter prefill tricks (URL hacking) that worked in Classic are unsupported in Lightning; use a Quick Action or Flow instead.
  • List buttons that act on multiple records need Display Checkboxes (row selection) enabled, or users have nothing to select.

See the full Web Links entry

Web Links includes the definition, worked example, deep dive, related terms, and a quiz.