Unlock Record

We’ve updated our component, check out the updated instructions here!

One of the great things about Approval Processes is the ability to lock a record so that a user cannot modify that record. One of the hard things to work around is when a locked record needs to be opened up to be edited again, for instance if, during electronic signature, the customer rejects the signature since they want to negotiate.

Enter the Unlock Record Apex Action, available with Process Builder or Flow! It is as simple as adding in your logic, say the a Quote status is updated to Rejected, then unlock the Quote.

Additionally, you can use this in Flow too. Simply select your Apex Action and add the record Id you’d like to unlock.

And voila, your Quote is unlocked! You can leave it as simple as below, or you can add in logic, like ensuring the Opportunity is not Closed Won, or other things like that!

NOTE: If running Unlock Record Apex Action in Flow, it does respect User permissions. So if a User does not have the permission to Edit a Locked Record, then they will not be able to unlock the record by simply clicking a button that launches to a Flow. Use Process Builder as Process Builder runs in system mode. If the logic is too complex for Process Builder, have Process Builder call the Flow to handle the more complex logic and then it can unlock the record. When Flow is called from Process Builder, it runs in system mode as well.

Run Flow Button

Run Flow Button - Lightning App Builder

We’ve updated our component, check out the updated instructions here!

Using Flow is one of the most powerful tools for an admin. The ability to create your own complex workflow allows you to effectively implement your business processes without code.

There are three ways Salesforce has allowed you to launch a Flow from a page as an admin. You can create a button with a URL button, something like “/flow/myFlow”, you can use a Quick Action and run the Flow inside of that, or you can add it to your page layout with the Flow lightning component. These are great ways to be able to run Flows, but there are a few short comings.

First, if you use a Quick Action or a Button, you can’t dynamically show or hide the Quick Action or the Button, you’re stuck using Page Layouts. Second, if you’re using the Flow lightning component, when it loads on the page, it will always run. An example below shows a New Contact Flow that always runs on the page.

This is why we built the Run Flow Button lightning component. Salesforce allows developers to run Flows in lightning components and now we’ve brought this power to the admins.

To use the Run Flow Button lightning component, simply open Lightning App Builder, drag the Run Flow Button lightning component onto your page, enter text for your button, add the Flow API Name, and now you have a button that your users can press when they want to run the Flow.

Since it is a lightning component, you can also dynamically show or hide the button based on the lightning component filter criteria.

With your Run Flow Button configured and your filters set, you’re ready to give your users an enhanced experience with Salesforce lightning!

Flow Components

Redirect Flow Example

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.