User Interface · Topic 2 of 3

Custom Buttons, Links and Actions, Including Mobile

Salesforce custom buttons and links, quick actions, object-specific vs global actions, predefined values, and actions in the Salesforce mobile app.

  • 4 min
In a nutshell
  • Custom buttons and links can use URLs, Visualforce or JavaScript; JavaScript is not supported in Lightning.
  • List buttons act on selected records in a list.
  • Object-specific actions relate to the current record; global actions do not.

What it is

Custom buttons and links open a URL, a Visualforce page or other content from a record or list. Quick actions let users create or update records, log calls, send email or launch flows and components with a few taps, on desktop and in the Salesforce mobile app.

Actions come in two kinds: object-specific actions, which work in the context of one record, and global actions, which can be used anywhere.

User on recordAction or buttonCreate, update, flowor open URLRecord savedor page opened

How it works

Custom buttons and links

SettingOptions
Display typeDetail page link, detail page button, list button
BehaviourOpen in a new window, the existing window and so on
Content sourceURL, Visualforce page, or JavaScript

List buttons can act on records selected in a list view, for example sending the selected records to a Visualforce page. JavaScript buttons are not supported in Lightning Experience; replace them with quick actions, flows or Lightning components.

Quick action types

Action typeObject-specificGlobal
Create a RecordYes, related to the current recordYes, not related to a record
Update a RecordYesNo
Log a CallYesYes
Send EmailYesYes
Custom Visualforce pageYesYes

Object-specific actions can also launch a screen flow or a Lightning component. Update a Record needs a record to update, so it exists only as an object-specific action. Global create actions make records with no automatic relationship to the current page.

Configuring an action

  • Choose the fields in the action's own layout, so the user fills in only what is needed.
  • Set predefined field values, such as Status = New or Type = Call, so users do not have to.
  • Add the action to the page: with Dynamic Actions in Lightning App Builder, or in the Salesforce Mobile and Lightning Experience Actions section of the page layout.
  • Add global actions to the global publisher layout, used on pages such as Home and Chatter.

Actions on mobile

The Salesforce mobile app shows actions in the action bar and action menu.

NeedSolution
Field workers log a visit from a recordObject-specific Create a Record action with predefined values
Create a contact from anywhere in the appGlobal Create a Record action on the global publisher layout
Update a status with two tapsObject-specific Update a Record action
Guide a complex mobile processScreen flow launched from a quick action

Keep mobile actions short: few fields, predefined values and a compact layout that shows the key fields in the record header.

A worked example: inspectors in the mobile app must record an inspection from a Work Order and mark the order as Inspected. The builder creates an object-specific Create a Record action for Inspection__c on Work Order, with three fields and predefined values for Date and Status, and an Update a Record action that sets the work order status. Both are added to the work order page through Dynamic Actions.

Exam tip

When users must create a record that is automatically related to the current record, use an object-specific action. When it can be created from anywhere, use a global action.

How the exam asks about this

  • "Create a related record with some fields already filled in." Object-specific action with predefined values.
  • "A JavaScript button does not work in Lightning Experience." Replace it with an action or flow.
  • "An action must be available from the mobile Home page." A global action on the global publisher layout.

What to remember for the exam

  • Custom buttons and links can use URLs, Visualforce or JavaScript; JavaScript is not supported in Lightning.
  • List buttons act on selected records in a list.
  • Object-specific actions relate to the current record; global actions do not.
  • Update a Record actions are object-specific only.
  • Predefined values and short action layouts speed up entry, especially on mobile.
Watch out

Creating an action does not make it visible. Add it to the page layout's actions section or with Dynamic Actions.

Common mistakes

Using a global action to create a related record. It will not link to the current record.

Keeping JavaScript buttons after moving to Lightning. They do not run there.

Forgetting to add the action to the layout. It stays hidden.

Check yourself

  • Which action type can only be object-specific?

    Update a Record, because it needs a record to update.

  • How can an action fill in some field values automatically?

    Set predefined field values on the action.

  • Where are global actions made available to users?

    On the global publisher layout.

Topic 2 of 3 in User Interface

Test yourself on User Interface

The full Salesforce Platform App Builder question bank has 648 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Salesforce. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.