douglascayers / sfdc-reloadable-flow-component

Demo embedding Flow (via Lightning Component) in Lightning Record Page and it reloading when the record is updated.
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Reloadable Flow Lightning Component

Overview

Demo embedding Flow (via Lightning Component) in Lightning Record Page and it reloading when the record is updated.

This project is a new take on my earlier project Reloadable Visualforce Lightning Component, whose purpose was to provide a way to display a Flow on a Lightning Record Page and have that Flow dynamically sync itself with any data changes made on the page.

That first project cobbled together a myriad of concepts, and although functional, it still didn't render the Flow in Lightning Runtime.

With Winter '18 we now have the component. We no longer need an <iframe> or Visualforce page to embed our Flow.

Demo Video

video

Installation

You may install the unmanaged code from GitHub and make any desired adjustments.

This will add a Lightning Component named ReloadableFlowCmp to your org (label in App Builder is Flow - Reloadable).

Getting Started

  1. Install this unmanaged package to your org using link above.
  2. Edit (or create new) a Lightning Record Page for an object (e.g. Account).
  3. Ensure the Standard component named Record Detail is on your Lightning Page.
  4. Drag the Custom component named Flow - Reloadable onto your Lightning Page.

screen shot

  1. Configure the Custom component by specifying Flow Name (e.g. Your_Awesome_Flow). The Flow should have an input variable named recordId of type text that the component will pass to the Flow based on the record being viewed.

screen shot

  1. Save and Activate your Lightning Record Page.
  2. Navigate to a record page to test.
  3. Edit and save the record and notice your Flow refreshes too!
  4. Click the Finish button on your Flow and notice the rest of the page refreshes too!