function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deanne Walters 6Deanne Walters 6 

Lightning Component and Flow not working

I am try to do this (https://automationchampion.com/2019/04/16/getting-started-with-lightning-flow-designer-part-4-need-to-redirect-a-user-to-a-new-record/) where a flow will redirect to a newly created record. The only code changes I made where changing all of the references to LeadID to RecID.

When I am debugging it ends as follows:
C:FLOWREDIRECT (LOCAL ACTIONS): Flow_Redirect
Inputs:
recId = {!FinalContractId} (80056000000UeBaAAK)
Outputs:
recId (80056000000UeBaAAK)

However when I am actually doing the flow it redirects me back to the start of the flow.

Any advice on what is going on would be appreciated.

It is a Lightning Component and here is my code.

Component Code:
<aura:component implements="lightning:availableForFlowActions" access="global" >
<aura:attribute name="recId" type="String" access="global"/>
</aura:component>

Controller Code:
({
invoke : function(component, event, helper) {
var redirectToNewRecord = $A.get( "e.force:navigateToSObject" );

redirectToNewRecord.setParams({
"recordId": component.get( "v.recId" ),
"slideDevName": "detail"
});
redirectToNewRecord.fire();
}
})

Design Code:
<design:component>
<design:attribute name="recId" label="Id of the New Record" />
</design:component>
Best Answer chosen by Deanne Walters 6
Deanne Walters 6Deanne Walters 6
The problem was I was triggering it from a button. See here for more details: https://help.salesforce.com/articleView?id=flow_concepts_finish_override.htm&type=5&sfdcIFrameOrigin=null

All Answers

Deanne Walters 6Deanne Walters 6
The problem was I was triggering it from a button. See here for more details: https://help.salesforce.com/articleView?id=flow_concepts_finish_override.htm&type=5&sfdcIFrameOrigin=null
This was selected as the best answer
Jimena IglesiasJimena Iglesias
Hace un par de días tuve el mismo problema. Según tu consejo pude cambiar el codo y hacer todo fásilmente. ¡Muchas gracias! He seguido el algoritmo de https://automationchampion.com/2019/04/16/getting-started-with-lightning-flow-designer-part-4-need-to-redirect-a-user-to-a-new-record/ enlace (https://es.casinority.com/es/).