2

so using the Override Finish Behavior feature https://help.salesforce.com/s/articleView?id=sf.flow_concepts_finish_override.htm&type=5

I am having issues routing the user to the newly created opportunity after they finish the flow.

To preface this, the user invokes the flow via a Detailed Page Button on contact which passes the variable varContactID to the flow. This is a part of the flow since the contact will eventually become a contact role on the opportunity. And when the opportunity is created, I pass the ID to the Lighting Component as recordId as seen below in the code.

So my question is there anything I need to update in the following code that will allow me to rereoute the user to the newly created flow when its done? I see Salesforce says that the Override Finish Behavior feature might not work properly when you run the flow from a Custom Button so I want to be sure this is the case. And if so, what do I need to update in the Aura Component?

Component Markup

<aura:component implements="force:lightningQuickAction, lightning:availableForFlowActions">
   <aura:attribute name="recordId" type="String" />
</aura:component>

Design Resource

<design:component>
   <design:attribute name="recordId" label="Record ID" />
</design:component>

Client Side Controller

({    invoke : 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();
}})

0

You must log in to answer this question.