How to Create a Salesforce Custom Button

Did you know that the DocuSign for Salesforce integration includes an option to create custom sending scenarios? This comes in handy when you need to utilize a template on a document, specify recipients, or modify the sending process.

In order to do so, your Salesforce Administrator will have to create a custom button that calls specific DocuSign variables for the situation in question.

For an in-depth reference regarding the button options, check out our section on Custom Buttons in the DocuSign eSignature for Salesforce Administrator Guide, as well as our guide on DocuSign eSignature for Salesforce Custom Button Logic.

Creating and Deploying Custom Buttons in Salesforce Lightning:

Before you begin, ensure you have the proper permissions to create a custom button in Salesforce.

Next, navigate to Setup > Object Manager > [Select Object in Question] > Buttons, Links, and Actions.



Next, select New Button or Link.

On the button creation screen:

  • Add the button label and name.
  • Click the Detail Page Button radio button.
  • Select Display in New Window as the Behavior and URL as the Content Source.
  • Add the custom button code as outlined by the button guide. For example, including a template from a custom button would entail adding the DST parameter

Select Save to save your new custom button.

Lastly, you'll need to add the new button to your record layout. 

  1. Setup > Object Manager > [Select Object in Question] > Page Layouts.
  2. Select the layout being used. 
  1. Navigate to the Mobile & Lightning Actions section and drag the button onto the layout, into the Salesforce Mobile and Lightning Experience Actions section.
  1. Select Save. Your button show now appear on the record layout.


Creating and Deploying Custom Buttons in Salesforce Classic:

First of all, make sure you have the proper permissions to create a custom button in Salesforce.

Next navigate to Setup > Customize > [Select Object in question, e.g., Opportunities ] > Buttons, Links, and Actions.

Next, select the New Button or Link button at the top of the page.

  • Add the button label and name.
  • Click the Detail Page Button radio button.
  • Select Execute JavaScript and OnClick JavaScript as the Behavior and Content Source respectively.

Then add the custom button code as outlined by the button guide. For example, including a template from a custom button would entail adding the DST parameter:

Next, select Save. 
Next Step is to add the Button to the Layout

To add a Custom button to a layout 
1.Navigate to a Salesforce Object (i.e. Opportunity)
2.Click Edit Layout
3. Select 'Buttons'
4.Drag and Drop the custom button
5.Click Save or Quick Save.