You need to sign in to do that
Don't have an account?
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.
Regards,
LinThaw
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}"/> </aura:component>
({ 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 redirect.setParams({ "recordId": record }); // Open the record redirect.fire(); } })
Regards,
LinThaw
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
https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/components_using_flow_onfinish.htm
But make sure you are checking the flow finish logic
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.
Core Action is working well instead of using Screen.
Love this one.
https://help.salesforce.com/articleView?id=flow_concepts_finish_override.htm&type=5
Flow Builder
Flow detail pages or list views
Web tabs
Custom buttons and links
https://help.salesforce.com/articleView?id=flow_concepts_finish_override.htm&type=5
I couldn't test this with custom button
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! :)
"The error has been reported. Click here to view Case 00001234."