How to Create Custom Detail Page Button in Salesforce

In this Salesforce tutorial, I will explain how to create a custom detail page button in salesforce lightning and salesforce classic.

The custom Detail Page button is a custom button that can be appended to a detail page of the particular object and this type of button can be used to execute particular actions on the record like creating or updating the record.

So, here we will discuss these topics in this Salesforce tutorial:

  • What are custom buttons in Salesforce?
  • Categories of custom buttons in Salesforce
  • How to create a custom detail page button in Salesforce
  • How to create a custom detail page button in Salesforce Lightning
  • How to create a custom detail page button in Salesforce Classic

What are custom buttons in Salesforce?

A custom button in Salesforce is a type of button that can be created for performing different tasks such as creating and updating records and these custom buttons are added to the related list for executing a particular task or action and set of actions.

The custom button is an elastic way to append the extra functionality to the standard and the custom Salesforce object and permit the users for executing a particular action or a set of actions.

So, with this, we understand What are custom buttons in Salesforce. Further, we will learn the categories of custom buttons in Salesforce.

Read: How to Create Custom Links in Salesforce

Categories of custom buttons in Salesforce

The custom buttons can be categorized into two main types:

  • Detail Page Buttons
  • List view Buttons

Detail Page Buttons: The button is shown on the detailed page of a single record and these custom buttons are added to the related list for executing a particular task or action and set of actions this type of button can be used to execute particular actions on the record like creating or updating the record.

List view Buttons: These buttons are shown on the list view page and can be used to execute actions on multiple records like updating and deleting the records, sending emails, or exporting data.

Here we are using the detail page button for creating a custom detail page button in Salesforce.

In the insertion of these two main categories, the custom buttons can be classified by their functionalities:

  • Custom Buttons
  • URL Buttons
  • Standard Buttons
  • Lightning Component buttons

Custom Buttons: These custom buttons are designed by the salesforce administrators.

URL Buttons: These buttons are used for executing a particular URL that permits users to launch an external web page.

Standard Buttons: Standard buttons are pre-defined buttons that are available in Salesforce.

Lightning Component Buttons: These buttons are built for using lightning components for creating a custom user interface.

So, with this, we learn about the categories of custom buttons in Salesforce.

Read: How to Update Records using Quick Action in Salesforce

How to create a custom detail page button in Salesforce

Here we are creating a custom detail page button in salesforce.  If you want to learn how to create a custom detail page button in salesforce then read the complete blog:

  • Go to the gear icon under the gear icon there are two options setup and service setup. Click on the setup after that click on the object manager.
  • Enter the object in the Quick Find Box the object is shown on the top click on it and select the object.
  • Click on the Buttons, links, and action option that is present under the details in the left sidebar.
  • On the object page, there is a new button or link option. click on the new button or link option.
  • After clicking on the new action button, the new button or link page is open. Under this new button or link page, lots of information is present. Fill in all the information carefully. Firstly fill in the label and then enter the name after that select the display type as Detail Page Button and then select the field type and then click on the save button.
  • After clicking on the save option the custom detail page button is created and we can edit or delete this created custom button or link after that select the page layouts option that is present under the details in the left sidebar.
  • After clicking on the page layout click on the layout option then click on the buttons then enter the button name in the quick find box and drag the button. After dragging the button into the custom button section and then click on the save option.
  • Go to the App Launcher type the sales option, the sales page is open then select the object option that is present in the nav bar. After selecting the object the object page is open select the record that is present under the object.
  • Here we are selecting the record, the record page is open and you can see that the detail page custom button is present under the record page.
  • After clicking on the custom button it redirects to google.com and the related information related to the record is searched on google. So this way we can create a custom detail page button in salesforce.

So, with this, we understand how to create a custom detail page button in salesforce.

Read: How to Create Compact Layout in Salesforce

How to create a custom detail page button in Salesforce Lightning

Here we are creating a custom detail page button in salesforce lightning. If you want to learn how to create a custom detail page button in salesforce lightning follow these steps:

Step-1: First, login into the salesforce lightning account. Go to the gear icon under the gear icon there are two options setup and service setup. Click on the setup after that click on the object manager.

How to create custom detail page buttons in salesforce
How to create custom detail page buttons in salesforce

Step-2: After clicking on the object manager, the object manager page is open under the object manager lots of objects are present. Enter the USA Employee object in the Quick Find Box the object is shown on the top click on it and select the USA Employee object.

How to create custom detail page buttons in salesforce lightning
How to create custom detail page buttons in salesforce lightning

Step-3: After selecting the USA Employee object, the USA Employee page is open. Click on the Buttons, links, and action option that is present under the details in the left sidebar.

Create custom detail buttons in salesforce
Create custom detail buttons in salesforce

Step-4: After selecting the USA Employee object, the USA Employee page is open there is a new button or link option. click on the new button or link option.

Create custom detail page buttons in Salesforce lightning
Click on the new button or link option

Step-5: After clicking on the new button and link, the new button and link page is open. Under this new button and link page, lots of information is present. Fill in all the information carefully.

Firstly fill in the label. Here we are entering the label as USA Employee Information and the fill name the same as a label and then select the display type as Detail Page Button for creating the custom button after that select the behavior as Display in a new window and then select the content source as URL.

Salesforce create custom detail page buttons
Fill the information

Step-6: Now select the field type as USA Employee then insert the field and create the URL that will send us to google and search for the related information. After writing the formula click on the check syntax option if there is no error in the formula then no syntax error in merge fields or functions message pops up and then click on the save option.

Salesforce lightning create custom detail page buttons
Click on the save option

Step-7: After clicking on the save option the USA Employee custom Button or link detail is created we can edit, and delete, and where this used option is present in this detail google page after that select the page layouts option that is present under the details in the left sidebar.

How to create custom detail page button in salesforce
Click on the page layout

Step-8:  After clicking on the page layouts option the Page layout page is open click on the USA Employee layout option.

How to create custom detail page button in salesforce lightning
Click on USA Employee Layout

Step-9: Click on the buttons option then enter the USA Employee Information in the quick find box and drag the  USA Employee Information option.

Create custom detail page button in salesforce
Drag the USA Employee Information button

Step-10: After dragging the USA Employee Information and drop it into the custom button section and then click on the save option.

Create custom detail page button in salesforce lightning
The USA Employee Information button is created

So, with this, we have learned how to create a custom detail page button in Salesforce lightning.

Read: How to Update Records using External ID in Salesforce

How to create a custom detail page button in Salesforce Classic

Here we are creating a custom detail page button in Salesforce Classic. If you want to learn how to create a custom detail page button in salesforce Classic follow these steps:

Step-1: Login into the salesforce classic account, click on the setup option that is present at the top of the page, and then search account object in the Quick Find Box and then scroll down to the bottom of the page there is a Build app under the build there is the option of an account under the accounts option there button, links, and actions objects option click on it.

How to create custom detail page buttons in salesforce classic
How to create custom detail page buttons in salesforce classic

Step-2: After Scroll to the bottom of the page there are Buttons, links, and an action section. Click on the new links and button option.

Create custom detail page buttons in salesforce classic
Click on a new button or link

Step-3: After clicking on the new links and button option, the new links and button page is open. Under this new link and button page, lots of information is present.

Firstly fill in the label. Here we are entering the label as Map the detail and the fill name the same as a label and then select the display type as  Detail Page button for creating the custom button after that select the behavior as Display in a new window and then select the content source as URL.

Salesforce classic create custom detail page buttons
Fill the information

Step-4: Now select the field type as Account then insert the field and create the URL that will send us to google and search for the related information. After writing the formula click on the check syntax option if there is no error in the formula then no syntax error in merge fields or functions message pops up and then click on the save option.

How to create custom detail page button in salesforce classic
Click on the save button

Step-5: After clicking on the save option, the Map the detail custom Button or link detail is created we can edit, and delete, and where this used option is present.

Create custom detail page button in salesforce classic
A custom button is created

Step-6: After creating this Map the detail select the page layouts option that is present at the bottom of the account page. After clicking on the page layout click on the account layout option.

Salesforce classic create custom detail page button
Click on the account layout

Step-6: Click on the custom link option then enter the Map the detail in the quick find box and drag the Map the detail option.

How to create a custom detail page button in salesforce
Click on the buttons

Step-7:  After dragging the Map the detail and drop it into the custom button section and then click on the save option.

Create a custom detail page button in salesforce classic
A custom button is placed

Step-8: Now again click on the setup then click on the account object, the Account page is open select the record that is present under the object.

Here we are selecting the Rashawn Dach record, the record page is open. There is the account detail of Rashawn Dach and beside this account detail option, there is a Map the detail button is present click on it.

Salesforce classic create a custom detail page button
Click on the map the detail button

Step-9: After clicking on the Map the detail button which is a custom button redirects to google.com and the related information related to Rashwan Dach’s record is searched on google. So this way we can create a custom button in salesforce and place those buttons on our record pages and we can also connect another source with this button.

Create a custom detail page buttons in Salesforce classic
Information is searched on google

In this way, we understand about how to create a custom detail page button in Salesforce Classic.

You may also like to read the following Salesforce tutorials.

Conclusion

In this tutorial, we have learned about the custom detail page button in salesforce. We have also discussed the categories of the custom detail page buttons in salesforce. In addition, we have covered how to create a custom detail page button in salesforce lightning as well as salesforce classic.

  • What are custom buttons in Salesforce?
  • Categories of custom buttons in Salesforce
  • How to create a custom detail page button in Salesforce
  • How to create a custom detail page button in Salesforce Lightning
  • How to create a custom detail page button in Salesforce Classic