Launching a Flow from a button typically falls into one of two use cases. First, is you can have a Screen in your Flow to interact with the Running User. The second scenario is that you could have a ‘macro’ type action fire and create record(s) after the button is clicked. For example, you could have a standardized task automatically filled out and marked as completed. Maybe then your Sales team will actually use tasks? We know why we would want to use a Button, but what type of Button should we use?
So, how do I create a Button?
Navigate to the Button, Links and Actions section for your target Object!
Now we get to determine the Name, Display Type, Behavior, and Content Source of our Button. Choosing the Name is just like when you create a custom field… no hidden secrets here!
Determining the Display Type is where you determine the location(s) that your button can be used. Lets take a look at these different choices:
Detail Page Link display gives you the ability to place your button as a hyperlink under your Custom Links section of the Page Layout. This method gives you the least amount of functionality.
Detail Page Button display gives you the ability to place the button onto the Object that you created the Button on. You can only place it to the right of your standard buttons, and it will be visible at the Top and Bottom of your page.
The List Button display gives you the ability to do some pretty cool things. This is how you would create a Button to show up on List Views and on Related Lists of records. Note, that if you were to create this display, it does not also function as a Detail Page Button, you would have to create another Button for that purpose.
Now we need to determine the Behavior for what happens after we click the Button. There are four different options. I typically never use the “Display in new window” option, but this all depends on the type UI you are looking to have. Take a look at the four options and select the one that fits your use case!
We have determined our Display Type and Behavior, now we need to determine what the Content Source of our Button will be! While we have four different options, we will only be using two of these for launching our Flow (URL & Visualforce Page).
If you select the Content Source URL, you will be given a editor to create your URL. Here you will be able to edit place a URL string that will launch your Flow. Don’t forget to use the “Insert Merge Field” assistance that Salesforce has provided you, it doesn’t bite!
If you select Visualforce Page, you will be given a list of all applicable Visualforce Pages that could be fired from this Object. You might be wondering, where is my Flow? Its not secretly a Visualforce Page… is it? You are right, it is not! You need to first create a Visualforce Page that references your Flow before you can use this option.
So, now I expect that you are feeling like a Button expert! We now need to figure out how to use a URL or Visualforce Page properly as our Content in a Button. Take a look at the next two posts to see how its done!
RECAP: Choosing your Button is only hard if you are indecisive. If you know how you want your button to be used and its UI, you’ll be making a few clicks and be on your way. Understanding the different ways that you can use a Button hopefully gives you an idea of the problems you can solve!