How to Add a Button in Salesforce Lightning
- Sophie Ricci
- Views : 28,543
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:
- Click Buttons, Links, and Actions in the left sidebar
- Click New Button or Link
- 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:
- In Object Manager, go to Page Layouts
- Select the layout you want to edit
- In the layout editor, scroll to the Custom Buttons section
- Drag your new button from the palette into the layout
- 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:
- Go to the object in Object Manager
- Click Page Layouts
- Click Page Layout Assignment
- 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:
- Go to Setup → Object Manager → [Your Object] → Page Layouts
- Edit the relevant layout
- In the Salesforce Mobile and Lightning Experience Actions section, click the wrench icon
- Drag your Quick Action from the palette into the action bar
- 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:
- Navigate to the record page where you want the button
- Click the Setup gear icon → Edit Page
- In the App Builder, drag a Flow or Quick Action component from the left panel
- Configure the component to point to your action or flow
- 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:
- In Object Manager, go to Buttons, Links, and Actions
- Click New Button or Link
- Set Display Type to List Button
- Check Display Checkboxes if the button should work on selected records
- Define the URL or action
Then add it to the related list:
- Go to the parent object’s Page Layout
- Click the wrench icon on the related list section where you want the button
- Under Buttons, move your custom button from Available to Selected
- 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?
Can I add a button without coding knowledge?
Why is my button not showing up in Lightning?
What happened to JavaScript buttons in Salesforce Lightning?
How many buttons can I add to a Salesforce record page?
We deliver 100–400+ qualified appointments in a year through tailored omnichannel strategies
- blog
- Sales Development
- How to Add a Button in Salesforce Lightning