Let's Build Your First Campaign Together with our Lead Generation Expert

How to Add a Button in Salesforce Lightning

Table of Contents

What Is a Button in Salesforce Lightning?

Buttons in Salesforce Lightning are clickable actions you can add to record pages, list views, and detail layouts. They let your team trigger workflows, open URLs, run scripts, or launch processes — all from within a Salesforce record.

According to Salesforce’s own research, teams that automate manual CRM tasks reduce data-entry time by up to 30%, freeing reps to focus on actual conversations rather than screen navigation.

There are three core button types you’ll work with in Salesforce Lightning:

  • Detail Page Buttons — appear on record detail pages
  • List View Buttons — appear above related lists or object list views
  • Quick Actions — appear in the action bar of Lightning record pages

Understanding which type fits your workflow determines everything that follows.

Why Buttons Matter More Than You Think

Before jumping into the steps, here’s why this is worth getting right:

84% of sales teams say they spend more time in their CRM than on actual prospect conversations, according to HubSpot’s State of Sales Report. That’s a painful stat — and most of it comes down to friction in the UI.

Buttons eliminate that friction. A single well-placed button can:

  • Launch a call with one click
  • Pre-fill and send an email template
  • Log an activity automatically
  • Push a record to the next pipeline stage

Salesforce reports that organizations with customized Lightning layouts see 25% higher CRM adoption rates compared to default setups. Buttons are one of the fastest ways to get there.

How to Add a Custom Button in Salesforce Lightning

Access Object Manager

Start by navigating to Setup from the top-right gear icon. In the Quick Find box, type Object Manager, then click on the object you want to modify — for example, Contact, Lead, or Opportunity.

This is your control panel for all things related to that object’s layout, fields, and actions.

Create the Button

Inside the Object Manager for your chosen object:

  1. Click Buttons, Links, and Actions in the left sidebar
  2. Click New Button or Link
  3. Fill in the required fields:
    • Label — what your team will see
    • Name — auto-populated from the label
    • Display Type — choose Detail Page Button, List Button, or Detail Page Link
    • Behavior — how the button opens (new window, current window, etc.)
    • Content Source — URL, Visualforce Page, or JavaScript (note: JavaScript is deprecated in Lightning; use Flow or Quick Actions instead)

For URL-type buttons, you can use Salesforce merge fields to make the URL dynamic. For example, linking to a Google search pre-filled with the account name.

Add the Button to the Page Layout

Creating a button doesn’t automatically display it. You must add it to a Page Layout:

  1. In Object Manager, go to Page Layouts
  2. Select the layout you want to edit
  3. In the layout editor, scroll to the Custom Buttons section
  4. Drag your new button from the palette into the layout
  5. Click Save

According to Salesforce documentation, over 60% of administrators report that the most common deployment mistake is creating a button but forgetting to assign it to the active layout for the right profile.

Assign the Layout to the Right Profiles

A page layout only shows to users assigned to it via Profile or Record Type. After saving your layout:

  1. Go to the object in Object Manager
  2. Click Page Layouts
  3. Click Page Layout Assignment
  4. Map the layout to the correct profiles

This is the step most people skip — and then wonder why their button isn’t visible to the team.

How to Add a Quick Action Button (Lightning-Native)

Quick Actions are the preferred way to add buttons in Lightning Experience. They’re faster to build, more flexible, and don’t require JavaScript.

Create a Quick Action

In Object Manager, select your object and click Buttons, Links, and Actions → New Action.

Choose from these action types:

  • Create a Record — opens a form to create a related record
  • Update a Record — edits fields on the current record
  • Log a Call — logs an activity directly
  • Send Email — opens an email compose window
  • Custom (Flow) — triggers a Salesforce Flow

Salesforce data shows that teams using Quick Actions with embedded Flows reduce manual data input by up to 40% compared to traditional URL-based buttons.

Fill in the label, description, and any predefined field values you want auto-populated when the action runs.

Add the Quick Action to the Lightning Page

Quick Actions appear in the Highlights Panel and the action bar at the top of a Lightning record page. To add them:

  1. Go to Setup → Object Manager → [Your Object] → Page Layouts
  2. Edit the relevant layout
  3. In the Salesforce Mobile and Lightning Experience Actions section, click the wrench icon
  4. Drag your Quick Action from the palette into the action bar
  5. Save the layout

If the “Salesforce Mobile and Lightning Experience Actions” section is locked with a message that says “overriding defaults,” that means no custom actions have been added yet. Click Override the Defaults to unlock and customize the bar.

How to Add a Button Using the Lightning App Builder

If you want more control over exactly where a button appears — including embedding it inside a specific component or page section — use the Lightning App Builder:

  1. Navigate to the record page where you want the button
  2. Click the Setup gear icon → Edit Page
  3. In the App Builder, drag a Flow or Quick Action component from the left panel
  4. Configure the component to point to your action or flow
  5. Save and Activate the page

This method gives you pixel-level placement control. It’s particularly useful when you want the button near a specific data section rather than in the default action bar.

According to Salesforce’s Trailhead research, Lightning App Builder is used by 73% of Lightning-enabled orgs to customize record page layouts — making it the dominant tool for advanced button placement.

How to Add a List View Button

List View Buttons appear above related lists on a record page — useful for bulk actions across multiple related records at once.

To create one:

  1. In Object Manager, go to Buttons, Links, and Actions
  2. Click New Button or Link
  3. Set Display Type to List Button
  4. Check Display Checkboxes if the button should work on selected records
  5. Define the URL or action

Then add it to the related list:

  1. Go to the parent object’s Page Layout
  2. Click the wrench icon on the related list section where you want the button
  3. Under Buttons, move your custom button from Available to Selected
  4. Save

Common Mistakes to Avoid

Not testing in the right Experience. Buttons behave differently in Salesforce Classic vs. Lightning. Always test your button in Lightning Experience, which is used by over 85% of new Salesforce deployments as of 2024.

Using JavaScript buttons in Lightning. JavaScript buttons were deprecated in Lightning. Use Flows or Apex-triggered Quick Actions instead. Salesforce disabled JavaScript button execution by default in Lightning as of Spring ’19.

Ignoring mobile rendering. More than 30% of Salesforce users access the platform on mobile, per Salesforce’s own usage data. Quick Actions designed for desktop may not render correctly on the Salesforce mobile app. Always preview layouts in mobile view.

Skipping profile assignment. Even a perfectly built button is invisible if the layout it lives on isn’t assigned to the right profiles. Review your Page Layout Assignment every time you push a new button.

When Buttons Alone Aren’t Enough

Salesforce buttons are powerful — but they’re reactive. They wait for someone to click them.

If your goal is to consistently reach the right people at the right time, you need an outbound system that works before anyone ever logs into Salesforce.

Over 78% of B2B buyers purchase from the first company that responds to their inquiry, according to Lead Connect’s research. That first touchpoint rarely happens inside a CRM. It happens in the channels where decision-makers actually spend their time — LinkedIn, email, and phone.

Building buttons inside Salesforce makes your team more efficient. Building an outbound engine outside of Salesforce is what fills the pipeline in the first place.

Conclusion

Adding a button in Salesforce Lightning is a multi-step process — from Object Manager to Page Layouts to Profile Assignment — but once you understand the structure, it’s repeatable across any object in your org.

The real leverage isn’t in the button itself. It’s in what the button triggers. Automating the right actions at the right moment in the sales process is what compounds efficiency over time.

Salesforce optimizes what happens after the conversation starts. SalesSo helps you start more conversations. If you want a complete outbound strategy — covering targeting, campaign design, and scaling — book a strategy meeting and we’ll map it out with you.

 

🚀 Skip the CRM Setup

Turn your Salesforce data into booked meetings — without extra tools or manual effort.

7-day Free Trial |No Credit Card Needed.

FAQs

What is the difference between a Quick Action and a custom button in Salesforce Lightning?

Quick Actions are Lightning-native, support Flows, and appear in the action bar. Custom buttons use URL or Visualforce and are better suited for redirects or legacy integrations. For most modern use cases, Quick Actions are recommended. Struggling to get meetings even after optimizing your CRM? A complete outbound strategy — targeting the right prospects, building the right campaign, and scaling it systematically — delivers results that no button configuration can replace. Book a strategy meeting with SalesSo to see how. Quick Actions are Lightning-native, support Flows, and appear in the action bar. Custom buttons use URL or Visualforce and are better suited for redirects or legacy integrations. For most modern use cases, Quick Actions are recommended. Struggling to get meetings even after optimizing your CRM? A complete outbound strategy — targeting the right prospects, building the right campaign, and scaling it systematically — delivers results that no button configuration can replace. Book a strategy meeting with SalesSo to see how.

Can I add a button without coding knowledge?

Yes. Quick Actions and Flow-based buttons require zero code. The Lightning App Builder and Object Manager provide fully point-and-click interfaces for creating and deploying buttons across record pages and layouts.

Why is my button not showing up in Lightning?

The most common reason is that the button was created but never added to the active Page Layout, or the Page Layout hasn't been assigned to the correct user profiles. Check Object Manager → Page Layouts → Page Layout Assignment to confirm the mapping.

What happened to JavaScript buttons in Salesforce Lightning?

Salesforce deprecated JavaScript button execution in Lightning Experience starting with the Spring '19 release. Existing JavaScript buttons still work in Classic, but in Lightning they display as links that don't execute scripts. Salesforce recommends migrating to Flows or Apex Quick Actions for equivalent functionality.

How many buttons can I add to a Salesforce record page?

Salesforce doesn't publish a hard technical cap, but UX research consistently shows that action bars with more than 5-7 actions suffer a drop in click-through rates. Keep your button set focused on the highest-frequency actions your team performs

We deliver 100–400+ qualified appointments in a year through tailored omnichannel strategies

What to Build a High-Converting B2B Sales Funnel from Scratch

Lead Generation Agency

Build a Full Lead Generation Engine in Just 30 Days Guaranteed