• Tran Thi Hong Ngoc 4
  • NEWBIE
  • -1 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
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}"/>    
</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