I made a flow who simply create a new Cutom Object's record where the user fill a screen component with the information of the future record.
I had a first problem where my flow won't stop after clicking on "Finish" button and so start over again.
I tried making a second Screen who use an aura component who should redirect to the new record.
My component :
<aura:component implements="force:lightningQuickAction, lightning:availableForFlowScreens, lightning:availableForFlowActions">
<aura:attribute name="recId" type="String" />
</aura:component>
The controller :
({ invoke : function(component, event, helper) {
// Get the record ID attribute
var record = component.get("v.recId");
// 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({
"recId": record
});
// Open the record
redirect.fire();
}})
The design file :
<design:component>
<design:attribute name="recId" label="Record ID" />
</design:component>
In my flow I retrieve the new record's Id and use it in my last screen :
Even with that my flow wont end and start over without redirecting to the newly created record. This flow is use in a ListView ButtonList using my Flow's URL. So this is not a Quick Action or a Custom Button, strangely ListView doesn't find Quick Actions using a Flow.