The Run Flow Button now allows you to refresh the Record and the Button after the Flow completes, as well as refresh the Flow if the Record is updated. The button is also available to be used in Communities as well.
In addition to using a URL, we’ve now included a Redirect To Id Flow Action to make redirecting to an Id even easier. We’ve also enhanced the redirect Flow Actions to use the latest navigation capabilities from Salesforce, which allows you to redirect in communities as well.
Flow Components has two options for you to redirect your Flow, you can either redirect your Flow to a new record or you can redirect your Flow to a URL. There are two Actions available in Flow, Redirect Flow – Record Id and Redirect Flow – URL. When you drag an Action interaction into the canvas, you’ll be able to type in redirect to see your two options.
Both Actions are available as a “headless” Action or can be displayed in a Screen as a button. For record id, you can add the record id for any record, including newly created records from your Flow. Simply put in the record id of the record you want to redirect to in the Record Id part of the Set Input Values and when your Flow lands on the Redirect Flow – Record Id Flow Action, the Flow will redirect to that record.
To be able to redirect your Flow to a URL, you can use the Redirect Flow – URL Flow Action. You can simply add your URL to the Redirect URL input in the Set Input Values section. This includes redirecting your Flow to a Record or any URL, and using variables from within your Flow to add to the URL. An example of redirecting the Flow using a URL with a recordId variable from within the Flow is below.
Additionally, you can use the Redirect Flow – Record Id and Redirect Flow – URL as a button in a Screen.
After selecting the Action in the Flow Screen, you can then fill in the appropriate information, such as the Record Id or the URL. The Button Label will display to the User as the button.
Flow Components has the ability to use a Lightning Component to launch a Flow through the click of a button. Launching a Flow through a button prevents the Flow from auto running when a record is loaded.
Using Lightning App Builder, you can find the Run Flow Button Lightning Component in the Custom – Managed Components section.
Once you drag it and drop it onto the page, you’ll be able to configure the component. The parts that you can configure are:
This is what will display to the User as the button
This is the API name of the Flow
This is optional. If you want to display a title to the Lightning Component card background, you can enter the text here.
Reload Flow When Record Refreshes
If this is checked, if the Flow has started and the Record has been updated after, it will refresh the Flow to start again.
Reload Button When Flow Finishes
If this is checked, when the Flow finishes, instead of staying on the default screen that lets the user know the Flow finished, it will reload the button to allow a User to start again.
Refresh Record When Flow Finishes
If this is checked, after the Flow finishes, the record will refresh and will display any updated information as a result of the Flow.
Flow Components come with the ability to unlock a record through a Flow Action. There are two inputs to the Unlock Record Action. The first is the Unlock Record Id, or the Id of the record that you would like to unlock. The second is System Unlock which is a Boolean of True or False, defaulted to False.
The Unlock Record Flow Action runs in user mode without any additional setup. This means that a User who does not have the ability to unlock the record will not be able to. There is the ability for an admin to configure Flow Components to run in System Mode.
Even if the System Unlock Input Value is set to true, it will not necessarily run in System Mode. This is to ensure that a User has explicit permission to be able to use the Unlock Record in System Mode.
The Flow Component package comes with a Custom Permission, Enable Unlock Record In System Mode. This Custom Permission is required in addition to the Unlock Record Action to be set to True. The Custom Permission can be added to a Profile, a Permission Set, or the Permission Set that comes with Flow Components can be assigned to the User, which is also named Enable Unlock Record In System Mode. These two things together are required for the Flow to run in System Mode.
Creating multiple Quick Actions for each Record Type means getting a lot of buttons on a page layout. Trying to create this in Flow can streamline the number of buttons down to 1. You can’t show all record types, however, as if a User selects a record type they don’t have access to, things break.
The Get Available Record Types Apex Action will allow you to check a User’s permissions with Record Types on a given object. Simply enter select the Get Available Record Types Apex action.
Then select the object that you want to retrieve the Record Types for.
And set the output of those records to a Record Variable that allows for multiple values with the Object type of Record Type.
You can also get the Default Record Type Id in a Text Variable.
Simply choose them in the output of the Apex Action.
And you can easily assign the default Record Type in your Flow!
NOTE: As of right now, this Apex Action has the main function of getting the Default Record Type. There is a Lightning Component that has been built that will allow you to display the Record Type List to the User, however there is a current Salesforce bug that is preventing this from being able to be added to the Flow Components package. https://success.salesforce.com/issues_view?id=a1p3A000000BMPtQAO Once this is resolved, we will update the package with the Record Type Picklist Lightning Component that will allow you to easily have users select the Record Type of the record they would like to create with the results of the Get Available Record Types Apex Action.
Being able to lock and unlock records is very helpful for ensuring data integrity. In Salesforce Classic, there used to be a lock icon to let you know when a record was locked.
This hasn’t made it over to Lightning as of yet. As a result, you can use the Locked Record Notifier to let Users know that the record is locked and in addition, you can use your own note.
Simply go to Lightning App Builder, select the Locked Record Notifier, drag it to where you would like it to show, and enter some text. If the record is unlocked during the Lightning App Builder Page edit, you’ll see it blank, like below, as the Locked Record Notifier will not show unless a record is locked.
If the record is locked during the Lightning App Builder Page edit, you’ll be able to see the preview.
The component will automatically show if the record is locked and will not show if the record is unlocked. This is a great way to let your users know a record is locked, and give them additional information if needed!
Salesforce Approvals are a great feature that allow you to be able to track approvals and lock records from having any changes after approvals. Sometimes, however, an Approval Process doesn’t fit into the situation that you’re trying to create. You know how to create a custom approval process to achieve the process part of it, but since you’re not using the standard Salesforce Approval Process, you can’t lock the record.
With the Lock Record Apex Action, you can now lock that record.
Use the Lock Record Apex Action with Process Builder to automatically lock a record based on something like, the status going to Approved.
Additionally, you can use Flow and the Apex Actions in Flow to lock a record.
A simple Flow will allow you to lock a record, or add your custom logic to lock the record only after it has gone through a custom approval.
NOTE: Unlike the Unlock Record Apex Action, any user who has edit rights on a record will be able to lock the record. This means that you can lock a record from a Flow button without having to use Process Builder.
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.