UPDATE: In Winter ’18 you can now launch Flows from a Quick Action on a record detail page.
—
This post is inspired by Matt Bertuzzi (@mattbertuzzi) who asked in the Lightning Now! group how to call an auto-launched Flow from a record page button in Lightning Experience.
Salesforce Classic
In Salesforce Classic this is as simple as creating a custom button whose URL points to the URL of your Flow. Read more about distributing flows via URL in Salesforce documentation.
Lightning Experience
However, in Lightning Experience, the urls for auto-launched flows are not yet supported but some new capabilities are in beta as of Winter ’17 release. Attempting to invoke an auto-launched flow from URL, such as from a custom button, would give you the error “This page isn’t available in Salesforce Lightning Experience or Salesforce1.”
To overcome this limitation we can take advantage of a few capabilities:
- Flows can be embedded in Visualforce Pages
- Visualforce Pages can be referenced by Actions
- Actions can be added as buttons on Page Layouts in Lightning Experience
Check out my video tutorial to learn how to easily implement this solution in your org:
Next Steps
Know of other ways to launch flows in Lightning Experience, please share in the comments below!
This is terrific, Doug! We’re still using Classic in our org, but I’d like to start influencing people to use Lightning. Of course I’ll need to be sure all the stuff they have access to in Classic is also available in Lightning (if possible), so this is information that is very timely for me. π
LikeLiked by 1 person
Thanks for the kind feedback Karen! Make sure to check out the Migrate to Lightning Experience trail on trailhead too https://trailhead.salesforce.com/trail/lex_admin_migration
LikeLike
Great post Doug, enjoyed video. It is worth a thousand words. Thank you.
LikeLiked by 1 person
Thanks Venkat! Glad you found the video useful π
LikeLike
Thanks Doug. Really useful video.
LikeLiked by 1 person
Glad you liked it, Dave!
LikeLike
Great video and blog post. Issue that I’m running into: my pop up window remains open after I click the action.
Flow: single Record Update to flip the IsPartner box to true
VF Page: exact same as yours minus the difference in variable names.
Flow kicks off and does the correct function, but it does not close after running the operation – pop up window is still open and have to manually refresh.
Aside from the finishLocation set to the Account.Id is there anything else that would be forcing the refresh? Is this because of IsPartner being technically a read-only field on the Page Layout?
Thanks!
Ricardo
LikeLiked by 1 person
Hi Ricardo,
Thanks for the kind feedback!
Does the action refresh the page if you try updating a different field than IsPartner or if you post a chatter message like in my video?
For example, I changed my flow from posting a chatter message to updating the account’s description to include the flow current date/time. I still got desired effect of page refreshing.
In your browser, open the Developer Console (usually press F12) and see if your org has any JavaScript or other errors that might be complaining about.
Try with and without Lightning LockerService critical update enabled in case that has anything to do with it.
Which browser are you using? I use Chrome in my tests.
Thanks,
Doug
LikeLiked by 1 person
Hi Ricardo – did you ever find a fix for your problem? I am having the exact issue with the persistent pop-up and no refresh. We are forced at work to use IE so Chrome isn’t an option.
LikeLiked by 1 person
Hi Dori,
Please have your IT team review the supported browsers for Salesforce Lightning Experience.
Internet Explorer 11 is being phased out. Perhaps try Edge, Microsofts newer browser which might be installed on your Windows computer already.
Doug
LikeLike
Hi Doug,
I’am using chrome browser, and i’am on updated version. But still it is a Popup and not refreshing the page. Any idea why?
Akhil
LikeLiked by 1 person
It seems that since I first wrote this blog post that the architecture for actions now embeds the Visualforce page in an iframe. This means the finish location parameter of the flow in the visualforce page is not causing your main page to refresh but rather only in the action pop up.
In the Winter 18 release we can now create Actions and reference a Flow, no Visualforce needed. The one caveat is that your Flow needs at least one screen element. You can have a single screen element in the flow to tell the user the action completed, or is running, etc. and then the user can close the action dialog. Still get the power of launching a flow at the touch of a button and the user is in control of closing the dialog.
Alternatively, you may be interested in using Andy Fawcett’s Flow Toolbelt or consider Clint Major’s dynamic flow ideas.
LikeLike
Great post, very useful video, thank you so much.
Do you know if there might be any plans coming soon to add in Lightning Experience more options for calling flow from record detail button in addition to Visualforce page button ?
For our implementations, the inconvenience of Visualforce Flow buttons is that is uses Classic runtime, in particular for user-interaction flow. You have mentioned above, URL buttons are not yet supported in Lightning Experience.
I read your blog about Allowing to embed the flow in Lightning page, that is good news, it will surely cover many of our use cases. I was wondering if there are any plans to go further in this direction. We are looking forward to βLightning Flowβ button in Lightning Experience in order to implement a record detail page button that the user can click in order to launch the flow page in a pop-up/or new page within the same window. The flow should automatically use Lightning Runtime (for both Classic & Lightning Experiences).
Looking forward to your reply.
Malgorzata
LikeLiked by 1 person
Thanks for the kind feedback, msikorska!
Summer 17 release brings some enhancements to Flows particularly around Lightning theme. Perhaps this resolves the issue you were having?
https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_forcecom_flow.htm
>
LikeLike
Thank you very much for your help. Yes, Summer’17 resolve the issue. When calling the flow from custom URL button in Lightning Experience, it uses Lightning runtime. That works for us perfectly.
Thanks a lot.
Malgorzata
LikeLiked by 1 person
Hi Douglas,
The video is amazing. It helped be to build VF button in Lightning. This button only appears with System Administrator profile.
I have granted below access to non- sys admin profiles but, it still not appearing on page layout.
Added profile to “Manage Force.com Flow” system permission.
Added profile to “Run Flow” system permission.
Added users to “Force.com Flow User” on profile page
Added button to page layout – “Salesforce1 & Lightning actions”
I am missing something here, please assist.
LikeLiked by 1 person
Hi Manglesh,
Glad you found the video helpful!
If you are using multiple page layouts then make sure the button is added to each of them as different profiles might be assigned different page layouts.
LikeLike
Doug — helpful post. I too am getting the scenario where the pop up window stays open. I tried with your sample scenario.. Any ideas?
LikeLiked by 1 person
Hi Tom, I’m not sure as the problem doesn’t occur for me. What browser are you using?
LikeLike
Hi Doug — I’m using Chrome…..very strange — basically, within the popup window, it’s bringing up SFDC again instead of refreshing the regular page.
LikeLike
Hi Tom,
Were you able to fix this? I am also experiencing the same.
I am using summer 17.
LikeLiked by 1 person
Perhaps related to this known issue: https://success.salesforce.com/issues_view?id=a1p3A0000001CaSQAU#38;title=flow-launched-from-button-is-not-redirecting-after-completion-in-ie11-when-lightning-runtime-is-enabled
LikeLike
Hi Gentlemen,
I was not able to resolve this issue using Chrome. I’m going to try again and will update.
LikeLike
Hi Doug, awesome blog. I’m trying to add flow lightning button onto the Product object. is this possible using the method above
LikeLiked by 1 person
Hello, thanks for the kind feedback!
I would assume this would work on Product page. Create a custom button that references a Visualforce page with the Flow embedded in it then add the button to the Product detail page layout.
What have you tried so far? Where are you getting stuck?
LikeLike
Thanks Doug. i got stuck at selecting actions on the Product Object. it only shows buttons & links. i used Button and this worked for both Classic & LEX
LikeLiked by 1 person
Hello Doug,
Awesome Job. I am trying to do the same exact thing but instead of the button on a record. I would like the button to be available on the “List View”. Using lightning interface I went to my custom object | Search Layouts | List View | Edit | Here I can see: “List View Actions in Lightning Experience” then I click “New Quick Action”, I tried all kinds of different types of actions, including a flow action but when I go back to the List View under Search Layouts, I am not able to add this button. Any ideas of what I might be doing wrong?
Thank you
LikeLiked by 1 person
Great question…. I’m not really sure why nothing appears in the “List View Actions in Lightning Experience” despite having created actions.
The only way that works for me is to create a custom button of type “List Button”.
I’m not sure if this is a bug, a known gap for Lightning Experience, or behaving as designed. You may want to reach out to Support and see what they can find out.
Thanks
LikeLike
Fantastic!!!! This was extremely helpful!
LikeLiked by 1 person
Glad to hear it, thanks for the kind feedback, Melissa!
LikeLike
I want to create a new button in Opportunity. When I press this button, it will jump to the quote page with standard create component.how can I do?
LikeLike
Hi Marison,
You can create a custom button/link whose URL references the new record page of an object you want to create. To know what the URL pattern needs to be, navigate in the Salesforce UI to create a record of the object type you’re interested in, note the URL path after the “.salesforce.com” and make that be your custom button/link URL.
Also check out this Trailhead module on Create Custom Buttons and Links in Lightning Experience.
LikeLike