+ Start a Discussion

How to open Record Page after finish Flow?

Hi there,

In Lightning Flow, I want to open case record detail page after finish my screen Flow.

To solve this, I added Lightning Component to Last Screen of my Flow.
Is it good idea to implement it or not?
Is there other ways to do this, please let me share.
<aura:component implements="lightning:availableForFlowScreens,lightning:availableForFlowActions">
    <aura:attribute name="recordId" type="String" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>    
    doInit: function(component, event, helper) {
        // Get the record ID attribute
        var record = component.get("v.recordId");
        // Get the Lightning event that opens a record in a new tab
        var redirect = $A.get("e.force:navigateToSObject");
        // Pass the record ID to the event
            "recordId": record
        // Open the record

Raj VakatiRaj Vakati
That is the best way only .. you have to customize the finish button to go to record page and 
 If you Set Flow Finish Behavior with a Flow URL in Lightning Experience URLs always redirect to the home page in Lightning Experience.

By default, when a flow user clicks Finish, a new interview starts and the user sees the first screen of the flow again. By embedding a flow in a custom Lightning component, you can shape what happens when the flow finishes by using the onstatuschange action. To redirect to another page, use one of the force:navigateTo* events such as force:navigateToObjectHome or force:navigateToUrl.

Refer this link


But make sure you are checking the flow finish logic 
if(event.getParam("status") === "FINISHED") {
        // Redirect to another page in Salesforce, or
        // Redirect to a page outside of Salesforce, or
        // Show a toast, or...

Andy Kallio 7Andy Kallio 7

Yes, there is an easier way to do this. There is a component that has already been developed. You can find it and others here: https://unofficialsf.com/flow-resources/
This group is also a helpful place: https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001rzc


More specfically it is the one called 'navigate to sobject' on this page: https://unofficialsf.com/flow-actions/


I have used it several times. 

Hi Andy Kallio, Thanks for sharing.
Raj VakatiRaj Vakati
Yes .. that true .. but  LinThaw  is already having the code ( Offcourse we can do same as with the flow actions )  and i dnt see any harm in the flow customize finish button 

Hi Raj Vakati, Thanks for idea.
Raj VakatiRaj Vakati
Can you close this threads .. if you dnt need any additional info 
please let me wait other ideas.
Raj VakatiRaj Vakati
sure .. there are two options flow actions vs using the finish button .. but your case flow finish is better option
User-added image
Core Action is working well instead of using Screen. 
Love this one.
@linthaw can you explain exactly what option in Core Action you selected? I can't seem to figure out how to do that with the link. It is a little intense and doesn't show visuals of what they did. 
I tried this and it's not working for me. I'm not sure what my formula should be if i want the action to return to the home page. It seems easy but it's not working and I'm getting frustrated. 

User-added image

User-added image
Tran Thi Hong Ngoc 4Tran Thi Hong Ngoc 4
I tried and found that this redirect logic works on 
Flow Builder
Flow detail pages or list views
Web tabs
Custom buttons and links


I couldn't test this with custom button
System Administrator 1101System Administrator 1101
I was looking into options for this when I ran across this thread.
My use case was a little different. I had an autolaunched flow that I called from a custom button to perform an action behind the scenes (ie, no screens) as there was no need to interact with the user. I appended the retURL parameter to the end of the URL for the Flow so when the flow is finished it refreshes the original record's page. Just wanted to add this here for future users who come across this thread! :)
System Administrator 1101System Administrator 1101
Also, on a more related note, In All onscreen flows, When a fault occurs, I display a screen with the error and give the user an opportunity to report the error. When they choose to do so I create a case. On the last screen, I disable finish and include a hyperlink to the newly created case.

"The error has been reported. Click here to view Case 00001234."
I want to create four buttons below finish button in screen flow, and by clicking those buttons user can redirect to recently uploaded listview pages, Four buttons for different types of assets, Please help, if anyone have solution for this  
Nima Pishva (DEV)Nima Pishva (DEV)
@linthaw, what core action did you use?