Create a Custom Button for Hub in Salesforce Lightning Experience


This article will illustrate how to add a button to your Salesforce Opportunities that will allow you to connect with the Windward Hub and generate reports for your Opportunities with a just a few clicks.

Setup Button for Salesforce Opportunities

The first step is to create a button that we can use on our Opportunities page that will redirect us to the Windward Salesforce Integration App that will allow us to generate a report for the given Opportunity. 

  1. Login to Salesforce and click the tool icon in the top right and choose "Setup".
  2. On the left sidebar in the Quick Find / Search box, type "Button" and you should notice an option for "Object Manager" under the Objects and Fields section. Click on that link.
  1. Once you navigate to that link, scroll down to till you see the label "Opportunity" and click on that.
  2. Now, on the left panel, select "Buttons, Links, and Actions"
  1. On the top right of the screen, select "New Button or Link"
  2. For the Label and Name you can choose whatever you would like to be displayed on the button.  For instance, you could call it "Generate Report".
  3. Next, set the display type to Detail Page Button.
  4. The behavior, you can choose to have it open in the current page or open in a new window.  This is up to you how you would like it to act, I will chose to "Display in new window" for this example as I believe this is the cleanest way to do it.
  5. Then, set the Content Source to URL.
  6. Finally, and most importantly, in the big open text box, you will enter the following link to have the button navigate to our Salesforce Integration App upon click.  The link is:;?id={!Opportunity.Id}&context=opportunity

Make sure that the link you enter is exactly the same as the link above otherwise your button won't work properly with the application.

Please note that this will be extendable to other Salesforce controllers such as Accounts, Contacts, Activities, etc in the future.  Currently there is support for Accounts and Opportunities.  To setup a button for Accounts, all steps are the same, the only thing you need to change is the URL here which would instead look like:{!Account.Id}

Note that all future supported controllers will follow this same model /Generate[ControllerName]/?id={Controller.Id}

  1. After the link is entered then the button should be complete and all you have to do is click "Save".  Here is an example of what the Custom Button form should look like.

Adding the Button to the Opportunities Page

  1. Now go back to the Object Manager and select"Opportunity" again.
  2. This time select "Page Layouts"
  1. Next, select one of your Opportunity layouts.
  2. In here you will have an area to select custom buttons, fields, etc.
  3. Under that editor, select the "Buttons" category on the left and you should see the custom button you made appear there.
  1. Drag and drop that button into the Custom Buttons section next to the Standard Buttons.
  1. After  you place your custom button, click "Save" up in the drag and drop layout editor and that button will then be available for all of your Opportunities.

You are now ready to generate reports for your Salesforce Opportunities with the Windward Hub!

If you don't see your custom button showing up:

Check in your page layout if you have custom "Salesforce Mobile and Lightning Experience Actions" configured:

To get the button to show up, you can either drag it from "Mobile & Lightning Actions" into the "Salesforce Movile and Lightning Experience Actions" section:

Or you can revert to mobile action defaults to use the default button configuration:


Add your comment

E-Mail me when someone replies to this comment