Admins

Salesforce Buttons, Links, and Actions – What to Use When?

By Stacy O’Leary

Buttons, links, and actions are standard functionality available in all orgs, and can be easily customized by an admin without any code. In general, buttons, links, and actions can be added to Salesforce (usually to a record) to do something. What they do depends on which feature you choose, and how you set it up.

In this article we’ll explore the different types of buttons, links and actions, how to set them up, and when to use one over the other.

Buttons and Links

Custom buttons and links serve the same function in Salesforce. They can be used to send a user to an external place, or to launch OnClickJavaScript or Visualforce.

From the custom button or link edit screen, you can select what happens when a user clicks the button or link, and where they will end up.

You should already be familiar with the standard buttons in the top-right corner of most pages in Salesforce – and this is also where you will find custom buttons. I have added in a custom button so the user can do a quick Google search on the Account.

Custom links appear in the custom links section on the page layout. I also added a custom link to do a Google search, as shown below.

As a declarative admin, this is the feature that I use most frequently – a detail page button that allows the user to do a quick Google search. You can also use this to do LinkedIn searches, etc.

Here’s the formula for doing a Google search if you want to use it in your org:

http://www.google.com/search?q={!Account.Name}

Custom Actions

There are a lot of applications for using actions! Essentially, actions allow you to make using Salesforce faster and easier for your users, by giving them a button (I know, it’s confusing!) to do something that might otherwise be time consuming. With actions, you can create a button to:

  • Create a record
  • Update a record
  • Send an email
  • Log a call
  • Customize Visualforce
  • Invoke a Lightning component
  • Invoke a web component
  • Trigger a flow

There are two main places you can go to create actions: at the record level or at the global level. Record-level actions are actions where you only need the button on a single record page. Global actions are actions that can be added to multiple objects/pages in Salesforce.

READ MORE: Salesforce Quick Actions [Interactive Tutorial]

Record-Level Actions

For this example, our use case is that our customer support team often receives feedback from a customer that a person no longer works at that account and has moved to some other account. We want to create a contact record for that person at their new account, rather than editing the existing record.

At the record level, in the Setup for your object, go to Buttons, Links, and Actions. Then click New Action.

For this instance, we can use an action to create a new contact record. Since our users are on the old contact page when this happens, we can create the custom action directly on the contact object.

First, we set our action to create a new contact record. Then we click Edit Layout to make the proper fields required and set some predefined fields for our users – this reduces the amount of manual typing they must do. Finally, we have to add our new action button to the existing contact page layout.

Now test it out! Navigate to any contact record:

When we click “Move to New Company”, Andy’s first and last name are prepopulated because this information has not changed. Also, “Account Name” and “Email” are required, because those are going to be different, and it is necessary to have this information. Finally, the default status is set to “Active”, but the user can edit this as needed. There is also space for Andy’s new Phone Number and Job Title.

By doing this, we’ve successfully saved the user from having to leave this screen to get to a “New Contact” button somewhere else, and we’ve also saved the user from having to copy and paste data (Andy’s name) from the old record to the new record.

Another example of a custom record action would be to launch a flow that takes multiple actions. For example, if you have a project record in your Salesforce, you could create an action button called “Complete & Invoice”. When the user is ready to complete the project and send an invoice to the customer, they can click the button to launch a flow. This could update the existing record to completed, create an invoice record, and send an email to the customer.

Global Actions

Global actions have similar capabilities to record actions but can be applied more broadly across Salesforce. While our two above examples only applied to specific records in Salesforce, global actions could be used any place that a button can be added. You may already be familiar with some standard global actions, like “New Case” or “New Task”.

For this example, our use case will be that our users need to be able to create a PoC record (custom object) quickly, and from almost anywhere in Salesforce. We can’t use a record action, because that will only appear on the one record page, so a global action is the better choice for this scenario.

From Setup, navigate to Global Actions. Then click New Action.

From the action edit screen, we can set up a name and what kind of record we want to create, as well as modify the success message.

As mentioned earlier, we also need to set up the action page layout, and the default field values.

Remember: Just creating the action doesn’t make it available anywhere. You’ll need to add this action to where you want it to appear (like page layouts).

Global actions can also be added to the publisher layout, so they’re accessible under the “+” sign in the top-right corner of your org:

Summary

Buttons, links, and actions have changed a lot over the years. There are so many use cases for them, especially when combined with flows, that the possibilities are endless!

I recommend spending time with your users to see what they’re actually doing in Salesforce. It’s likely they have repetitive tasks that could easily be replaced with buttons, links, or actions. Even if a process can’t be fully automated, these features allow you to save a little bit of time and minimize frustration.

Let me know what your favorite use cases are for buttons, links, and actions in the comments below!

The Author

Stacy O'Leary

Stacy is a 5x Certified Salesforce Consultant & Full Time Mom.

Leave a Reply