8.3 Custom Buttons, Web Links & Quick Actions
Key Takeaways
Custom Buttons and Links provide point-and-click record interaction: Detail Page Buttons act on individual records, List Buttons operate on related lists or list views (with or without multi-record selection checkboxes), and Detail Page Links appear in the Custom Links section.
OnClick JavaScript custom buttons are deprecated, completely unsupported, and ignored in Lightning Experience; legacy JavaScript buttons must be re-architected as Quick Actions, Screen Flows, or Lightning Web Components.
Pre-populating field values on record creation in Lightning Experience is supported natively via URL parameters using the
/lightning/o/[Object]/new?defaultFieldValues=syntax, replacing legacy Classic URL hacking.Global Actions operate independently of record context and are managed on Global Publisher Layouts, whereas Object-Specific Actions are contextual to the record and can update the current record or create related child records.
Object-Specific Actions support Predefined Field Values, allowing administrators to automatically set default field values via formulas or static text without requiring those fields to appear on the action's modal layout.
Custom Buttons, Web Links & Quick Actions
User productivity in Salesforce depends heavily on minimizing friction: reducing unnecessary page navigation, eliminating redundant data entry, and automating multi-step business transactions. In Salesforce Lightning Experience, administrators achieve this through three fundamental declarative interaction mechanisms: Custom Buttons, Custom Web Links, and Quick Actions.
While these tools share the common objective of triggering automated behaviors or presenting user input forms, they operate under distinct architectural boundaries regarding record context, placement locations, and platform execution. Mastering these distinctions is one of the highest-yield topics on the Platform App Builder certification exam.
Custom Buttons & Custom Links
Custom Buttons and Links are configured in Object Manager > [Object] > Buttons, Links, and Actions. They allow administrators to create navigation shortcuts, invoke external web services, pass parameters to external portals, or launch Visualforce and Flow pages.
Button & Link Display Types
When creating a custom button or link, the builder must designate its Display Type:
- Detail Page Link:
- Renders as a clickable text hyperlink within the "Custom Links" section of the record detail.
- Typically used for informational navigation, such as opening an external search engine with record merge fields (
https://www.google.com/search?q={!Account.Name}), linking to corporate intranets, or opening pre-filtered operational reports.
- Detail Page Button:
- Displays prominently in the record Highlights Panel or page action bar.
- Operates in the context of the single record currently viewed.
- Used to execute transactional actions on that specific record, such as launching a credit check wizard, generating a customer statement, or navigating to an external ERP portal.
- List Button:
- Displays on Related Lists (on a parent record page) or on standard List Views for an object.
- Controls how users interact with multiple child records simultaneously.
- Display Checkboxes (for Multi-Record Selection):
- When this setting is enabled, checkboxes appear alongside each row in the related list or list view. Users can select multiple records and click the button to perform a batch action (e.g., mass record deletion, mass owner reassignment, or mass status updates via Visualforce or Screen Flow).
- When this setting is disabled, the button serves as a general list-level action (e.g., launching an external bulk import utility or a specialized record creation wizard) without allowing multi-record selection.
+--------------------------------------------------------------------------+
| CUSTOM BUTTON DISPLAY TYPES |
+---------------------+----------------------------+-----------------------+
| DETAIL PAGE BUTTON | DETAIL PAGE LINK | LIST BUTTON |
+---------------------+----------------------------+-----------------------+
| Single Record Scope | Single Record Scope | Multi-Record / List |
| Highlights Panel | Custom Links Section | Related Lists & Views |
| Transactional | Informational / Navigation | Batch / Multi-Select |
| Actions on 1 Record | Hyperlinks to External/Rpt | Checkboxes for bulk |
+---------------------+----------------------------+-----------------------+
Content Source Types & The Legacy JavaScript Trap
Custom buttons and links support three content source types:
- URL: Opens an internal or external web address, supporting merge fields and formula functions.
- Visualforce Page: Invokes a custom Visualforce page that operates under the standard controller of the object.
- OnClick JavaScript (CRITICAL EXAM TRAP): In Salesforce Classic, developers frequently wrote client-side JavaScript buttons to validate fields, query database tables via AJAX, and execute synchronous DML updates.
Important
The Deprecation of OnClick JavaScript: OnClick JavaScript custom buttons are completely unsupported and ignored in Lightning Experience. Due to the security model of modern browsers and Lightning Locker / Lightning Web Security (which prevents arbitrary DOM manipulation and cross-site scripting vulnerabilities), JavaScript buttons will not render or execute in Lightning. Any exam question proposing an OnClick JavaScript button to solve a problem in Lightning Experience is ALWAYS incorrect. Legacy JavaScript buttons must be converted into Quick Actions, Screen Flows, or Lightning Web Components.
Pre-Populating Fields via URL Parameters in Lightning Experience
In Salesforce Classic, administrators developed unsupported, fragile URL hacks using internal HTML input element IDs (e.g., /006/e?CF00N40000001pt12=...) to pre-populate fields when creating new records. In Lightning Experience, Salesforce introduced an official, fully supported declarative URL parameter syntax:
/lightning/o/[ObjectApiName]/new?defaultFieldValues=[Field1=Value1,Field2=Value2]
Syntax Architecture and Rules
- Base Navigation Path:
/lightning/o/Opportunity/newopens the standard record creation modal for Opportunities. - Query Parameter:
?defaultFieldValues=instructs the Lightning runtime to inject predefined values into the creation modal. - Comma-Separated Mappings: Field assignments are comma-delimited key-value pairs matching exact field API names:
StageName=Prospecting,Probability=20. - Dynamic Merge Fields: Record values from the source object can be injected dynamically:
AccountId={!Account.Id}. - Formula Functions & Date Calculations: Standard formula expressions are supported:
CloseDate={!TODAY()+30}. - URL Encoding: If a text value contains spaces, ampersands, or commas, it must be escaped using the
URLENCODE()formula function:
/lightning/o/Opportunity/new?defaultFieldValues=
AccountId={!Account.Id},
Name={!URLENCODE(Account.Name & ' - Annual Renewal')},
StageName=Qualification,
CloseDate={!TEXT(TODAY() + 30)}
When a user clicks a custom Detail Page Button configured with this URL, Salesforce opens the standard Opportunity creation modal with the Account, Name, Stage, and Close Date already filled in, while still allowing the user to make adjustments before clicking Save.
Quick Actions: Global vs. Object-Specific Actions
Quick Actions provide a streamlined, modal-based mechanism for users to create records, update fields, log calls, or trigger automations without navigating away from their current page.
+-----------------------------------------------------------------------------+
| QUICK ACTION ARCHITECTURE |
+------------------------------------+----------------------------------------+
| GLOBAL ACTIONS | OBJECT-SPECIFIC ACTIONS |
+------------------------------------+----------------------------------------+
| Configured in: | Configured in: |
| Setup > Global Actions | Object Manager > [Object] > Buttons... |
| | |
| Record Context: | Record Context: |
| NO context (Independent) | CONTEXTUAL (Tied to current record) |
| | |
| Capabilities: | Capabilities: |
| - Create a Record (Unrelated) | - Create a Record (Relates to parent!) |
| - Log a Call | - Update a Record (Edits current rec!) |
| - Visualforce / Aura custom action | - Log a Call (Relates to current rec) |
| - Send Email | - Launch Screen Flow (Passes recordId) |
| - Lightning Component modal | - Lightning Component modal |
| | |
| Limitations: | Superpower: |
| CANNOT Update an existing record! | PREDEFINED FIELD VALUES |
| CANNOT auto-relate to parent rec! | Automatically populates values without |
| | displaying them on the modal layout! |
+------------------------------------+----------------------------------------+
1. Global Actions
- Configuration: Setup > User Interface > Global Actions.
- Context: Global actions have no record context. They can be invoked from anywhere in the application.
- Placement: Managed on Global Publisher Layouts. They appear in the Lightning global header (the
+icon in the top navigation bar), on Chatter feeds, on Home Pages, and can also be added to Record Pages. - Supported Types: Create a Record, Log a Call, Visualforce, Canvas, supported Aura Lightning Component, and Send Email.
- Critical Architectural Boundary: The native Update a Record quick-action type is object-specific. A global custom component can implement additional behavior, so do not interpret that type restriction as a ban on all custom global interfaces modifying records. Furthermore, when a Global Action creates a record, it cannot automatically link that record to the record the user is currently viewing because it has no awareness of the surrounding page context.
2. Object-Specific Actions
- Configuration: Object Manager > [Object] > Buttons, Links, and Actions.
- Context: Deeply bound to the record where they are invoked. Automatically receives the active
recordId. - Placement: Added to the object's Page Layout (within the Salesforce Mobile and Lightning Experience Actions section) or configured directly via Dynamic Actions on the Lightning Record Page.
- Supported Action Types:
- Create a Record: Creates a new record that automatically relates to the current record via an existing lookup or master-detail relationship (e.g., clicking "New Child Case" on an Account automatically links the new Case to that Account).
- Update a Record: Opens a focused modal allowing users to edit a specific subset of fields on the current record without opening the full edit page.
- Log a Call: Records a completed task linked automatically to the source record.
- Custom Flow: Launches a Screen Flow, automatically passing the current record's ID into the flow's
recordIdvariable. - Lightning Component: Launches an interactive LWC or Aura component inside a contextual modal.
Action Layouts & Predefined Field Values
Every Create a Record and Update a Record Quick Action has its own dedicated Action Layout.
- Streamlined Layouts: Rather than presenting an intimidating page layout containing 60 fields, the action layout can be stripped down to just 3 or 4 essential fields (e.g., Subject, Description, Due Date), drastically speeding up user workflows.
Predefined Field Values (The Declarative Superpower)
Administrators can configure Predefined Field Values on supported fields on an Object-Specific or Global Action:
- Predefined values can be static strings/numbers or dynamic formula expressions (e.g., setting Case
Priorityto'High'or OpportunityCloseDatetoTODAY() + 14). - Hidden Field Population: Crucially, fields with predefined values do not even need to be included on the Action Layout! The platform automatically applies the predefined value in the background during transaction execution.
- Exam Scenario: If an organization requires that every Case created from an Account page must have its
Originautomatically set to'Web'and itsStatusdefaulted to'New', but management does not want these read-only administrative fields cluttering the user's quick action modal, the app builder configures Predefined Field Values on the action and removes the fields from the Action Layout.
Comparison: Global vs. Object-Specific Quick Actions
| Architectural Attribute | Global Quick Action | Object-Specific Quick Action |
|---|---|---|
| Configuration Location | Setup > Global Actions | Object Manager > [Object] > Buttons, Links, Actions |
| Contextual to Record? | No | Yes (Contextual to active record) |
| Can Update Current Record? | No (Creation & Utility Only) | Yes (Update a Record Action Type) |
| Automatic Foreign Key Binding | No (User must manually select parent) | Yes (Automatically sets parent lookup ID) |
| Predefined Field Values | Yes (Static or Formula) | Yes (Static or Formula, including parent fields) |
| Placement Locations | Global Header (+), Home, Chatter, Record Pages | Record Page Layouts, Dynamic Actions Bar |
| Flow Integration | Use a supported custom wrapper or another Flow distribution surface | Native object Flow action passes recordId |
Exam Traps and Best Practices
- Trap: Selecting Global Actions to Relate Records. If an exam question asks how to allow users to create an Opportunity from an Account record with the Account Name prepopulated, never choose a Global Action. Global actions have no record context; an Object-Specific Action is required.
- Trap: JavaScript Buttons in Lightning Experience. Any question that involves migrating from Classic and mentions JavaScript buttons should be flagged immediately: JavaScript buttons must be replaced with Quick Actions, Flows, or LWCs.
- Best Practice: Predefined Field Values over Custom URL Parameters. While Lightning URL parameters (
defaultFieldValues) are powerful for full-page record creation, Object-Specific Quick Actions with Predefined Field Values are cleaner, mobile-friendly, do not require custom button URL syntax, and open in responsive modals that keep users anchored to their current record.
A Button Needs an Implementation
A list button with selection checkboxes does not itself perform a batch update. It needs a supported implementation that consumes the selected records and applies the business operation. Prefer an existing standard mass action when it already meets the need, such as Add to Campaign for selected Leads or Contacts. Direct Flow quick actions are object-specific; a global custom action can use a supported wrapper where appropriate. Do not assume that native global Flow or global LWC record actions exist merely because object-specific equivalents do.
Official Source Check
Checked October 19, 2026: Quick action types and contexts.
Universal Containers requires customer service agents to create a specialized Return Merchandise Authorization (RMA) custom record directly from an Order record page. When creating the RMA, the Order lookup field must automatically link to the source Order, the RMA Status must default to 'Initiated', and the Priority must default to 'High'. Management wants to ensure that agents only see and populate the 'Return Reason' and 'Customer Notes' fields on screen. What declarative solution should the app builder implement?
Create a Global Create a Record Action, add Return Reason and Customer Notes to the layout, and train agents to manually select the Order
Develop an OnClick JavaScript Detail Page Button on the Order object that validates input and updates the RMA fields via the AJAX toolkit
Build an Autolaunched Flow triggered by a custom Detail Page Link on Order that creates the RMA record with hardcoded values, then collect Return Reason and Customer Notes by enabling Screen Mode so the flow prompts agents with an input card over the Order record page
Create an Object-Specific Action on Order to Create a Record (RMA), configure Predefined Field Values for Status and Priority, and place only Return Reason and Customer Notes on the Action Layout
An organization is migrating its sales operations from Salesforce Classic to Lightning Experience. An app builder discovers twelve custom buttons on the Opportunity object that use OnClick JavaScript to validate complex line-item configurations before redirecting users to an external billing application. What must the app builder do to ensure these workflows continue functioning in Lightning Experience?
Re-architect the JavaScript buttons into Lightning Quick Actions, Screen Flows, or custom Lightning Web Components
Enable the 'Execute Legacy JavaScript in Lightning' checkbox under Session Settings in Setup, then register each Opportunity button in the JavaScript Console Registry to whitelist it for Lightning record pages
Convert the custom buttons into Detail Page Links with an OnClick JavaScript content source type
Deploy the Salesforce Classic Extension package from the AppExchange to sandbox environments
Sales representatives need to select up to 200 Leads in a list view and add them to a marketing campaign. Which standard capability should the builder make available to appropriately permitted Marketing Users?
A Detail Page Button that works on one Lead only.
A global Update a Record action with invented bulk-execution settings.
A Detail Page Link that cannot pass selected Lead records.
The standard Add to Campaign action on the Lead list view.
Sections you finish are checked off in the contents.