Lightning Components to Extend your Flows

We’ve created a Package to extend your Lightning Flows using Lightning Components. We’re working on getting the full documentation for you and posts about each of the Lightning Components. Feel free to download the package from the AppExchange, we’ll add the new posts as soon as possible!  https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FvN3wUAF

Lightning Component – Redirect Flow – Use inside a Lightning Flow to dynamically redirect the Flow to any URL you set or allow Users to click on a Button to redirect them. This includes redirecting Users to a record that was created inside the Flow, or adding URL variables, such as with a Conga Composer button, based on User selections inside the Flow.

Lightning Component – Run Flow Button – Use on a Lightning Page to create a button that when clicked, will run a Lightning Flow. Instead of the Flow running automatically when the page is rendered like the standard Flow Component, this will only render the Flow when a User clicks the button. Can be combined with Component Filters to only show the button in certain situations.

Apex Action – Unlock Record – Use inside Process Builder or Lightning Flow to unlock a record. Helpful for unlocking a record after an outside action has happened, such as a Quote being declined in an e-signature process, allowing a User to then edit the Quote again and resend for signature from the client.

Apex Action – Lock Record – Use inside Process Builder or Lightning Flow to lock a record, no standard approval process required. Helpful for building custom approval workflows with record locking at the end when the standard approval workflows are not robust enough.

Lightning Component – Locked Record Notifier – Use on a Lightning Page to notify the User if a Record is locked. Enter in your custom message to the User if the Record is locked in the Lightning App Builder. Lightning Component will not display if Record is unlocked.

Apex Action – Get Available Record Types – Use inside Lightning Flow to get the available Record Types for a User, based on the Object. Default Record Type Id for that User is sent back in addition to the List of Record Types allowed for the User. Use with Record Type Picklist Lightning Component to display Record Type selection to the User in a Lightning Flow.

Coming Soon – Lightning Component – Record Type Picklist – Use this Lightning Component inside a Lightning Flow Screen to display Record Types to the User for selection. Use in conjunction with the Get Available Record Types Apex Action to show a User the Record Types they are allowed to create.

21 comments

  1. This sounded like a great solution for re-directing the finish location on a flow to a newly created record + easy to set up, The trouble is I get an error when I use this as the last step on the visual flow and I have not found much in regards to solving this.
    Error =
    FLOW_ELEMENT_ERROR| This flow contains local actions, so this flow runs only in Lightning runtime.

    Flow is called from a visualforce page button which has no finishlocation option and is being run using Lightning version of Salesforce and the url path is lightning specific. Why would this error happen with SF Lightning??

  2. In follow up to my last msg… on runtime error with this redirect component….I notice when a user advice/input screen displays during the flow that it is in Classic runtime style hwich fits in with the error on your component. The flow is being run from a VF button on a lightning page. salesforce help says…
    Flows that run from a Lightning page, flow action, or custom Aura component always use Lightning runtime. Any advice on how I can get this flow to work with your component?

    1. Hi Scott,

      Any way that you could launch it from a flow button (part of the package) instead of a Visualforce page button? I’m not too sure as to how the local lightning actions work inside of a visualforce page.

      Rich

    2. Hi Scott,

      Try using our flow button instead of VF. Even though your VF page button is in Lightning, the flow isn’t running on Lightning in this instance, it is running inside the VF container.

  3. Excellent features and am excited to use. I have tried the Run flow button lightning component with two of my screen flows, but when it seems when the flow reaches an Update record or Create record element it restarts the flow instead of performing the action and continuing the flow.

    The flows work correctly as normal Flow Screen components on the page but i’d like to use the button. Any ideas on what could be going wrong?

    1. Hi Patrick,

      I’ve never experienced that before. Is this happening in Summer 19 or Winter 20? Are you getting any error messages? If you can post a screen shot of the flow builder, that might help troubleshoot.

      1. Hi Rich, currently not letting me post a screenshot here but the flow is a simple screen flow with:

        Get Records -> Get Records -> Screen -> Create Records -> Email Alert

        Currently testing in a Developer sandbox on a winter 20 preview. I’ll try a partial copy sandbox still on a spring 19 to see if i can get it to work. No error messages on the flow, just restarts to the first screen component each time.

      2. Hi Patrick,

        Flow does restart after it finishes, that’s one of the ways it works, which is why there is the redirect flow core action.

        You might not receive an email in sandbox if deliverability is turned off. If it is off, try turning it to all email instead of system and run the flow again. If it sends the email, then everything is running correctly. I would suggest adding the redirect flow core action at the end and put the URL to the original record, it essentially runs the flow and then refreshes the page.

  4. Hi Rich, I think i may have found whats missing but not sure on the solution. When adding a screen flow to a lightning page you can select to pass the record into into a variable designated for input in the flow – which i do have set up for the screen flow. When run the flow through the button, there is no option to pass the record id into the flow variable. Is that available elsewhere with the button feature?

    1. Hi Patrick,

      Flow with Salesforce has some automation around that. For your input variable for the flow, use “recordId”, with the only the i capitalized. It should pass the record Id to that variable automatically as long as it is available for input. I’ll check the instructions again and update that note if it is not in there.

  5. I have a requirement to have a custom button on Case that creates a Child case through flows and redirect to either parent or newly created child case. We are using service console. I tried the following options
    1. Added return url with Case.Id to the flow Url on the custom button – After the flow is finished, its redirecting to the parent case. However upon refresh I see that Flow Instance subtab is still open
    2. Tried to download your flow component and set the redirect URL variable with the newly created case variable in the flow – The flow instance remains.
    Using Lightning Console JavaScript API is the only solution for this ?
    Appreciate your help

    1. Hi Kausar,

      I have an updated package coming out, most likely by Monday. I would suggest trying with the new package, if that doesn’t work, then you might need to use another solution, like the Console JavaScript API. I do have the new package working with Console, so I would think that it should work for you for navigation once it is released.

  6. I am using your Unlock Action to update a record that has been locked through an approval process In my flow error, it shows the correct record Id in UNLOCK RECORD (APEX) with isSuccess(true) but that same recordId then shows as cannot update because the record is locked: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: triggerCreateJournalEntry: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a3H3i0000001X1eEAE; first error: ENTITY_IS_LOCKED,

    My flow is running in System Context.

    1. Hi Allen, please read the blog post on the unlock record flow action. https://englhardconsulting.com/flow-components-unlock-record/

      Even though the flow is running in system mode, it calls code that is not running in system mode. If you would like it to, there is a configuration that can be done to run code that runs without sharing (system mode) if you set the permission and the flow to run in system unlock. Let me know if you have any questions on that post, thanks Allen!

  7. Hi Rich,

    I am trying to use redirect flow feature but this is not working if I launch a flow from a VF page. Is that something not supported?

    1. Hi Haseeb,

      Visualforce runs in classic interface, so the development for that would need to be done in the visualforce page/apex controller. Here is a link to the Salesforce docs. https://help.salesforce.com/articleView?id=flow_distribute_internal_vf_finish.htm&type=5

      If instead you’d like to control it via the flow, you can redirect the user in the VF to Flow using our lightning component/URL, which will then run the Flow in lightning runtime, allowing you to redirect the user inside of the Flow instead of capturing the information outside of the flow with VF/Apex. Here is a link to our URL documentation to call Flow in Lightning Runtime through a URL – https://englhardconsulting.com/call-flow-in-lightning-runtime-through-a-url/

      Please let me know if that helps, thanks Haseeb!

      Rich

  8. Hi,

    Had some clarifying questions about the Lock Record and Unlock Record Apex actions:

    1) After a record is locked via the Flow Component’s Apex Action, would it be possible to make field updates on the same record via Process Builder or Flow?
    2) After a record is locked, can a certain user/group of users be given access to edit the record? (while the record remaining locked for any other user)

    Regards

  9. Hi Rich,

    Had a clarifying question about the Record Lock and Unlock features:

    Can the record be set to Locked only for a specific set of users? This would mean that the record is editable for every other user except for those who it has been locked.

    Regards,
    Kanishk

Leave a Reply to Kanishk ShekharCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Englhard Consulting LLC

Subscribe now to keep reading and get access to the full archive.

Continue reading