I'm using a ltng:outApp
that opens a lightning:flow
from a visualforce page. The flow takes multiple inputs from the user and creates a record on a custom object. When the flow finishes I'm trying to redirect the user to the newly created record detail page. I've tried creating a simple aura lightning component:
cmp:
<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId,lightning:availableForFlowScreens,lightning:availableForFlowActions" access="global">
<aura:attribute name="recordId" type="String" />
<aura:handler name="init" value="{!this}" action="{!c.invoke}" />
</aura:component>
js.controller:
invoke : function(component, event, helper) {
var record = component.get("v.recordId");
var redirect = $A.get("e.force:navigateToSObject");
redirect.setParams({
"recordId": record,
});
redirect.fire();
}
The console log shows the invoke function being entered and the variable holds the correct record id value, but the navigateToSObject
doesn't fire. Is it possible to redirect to the record detail page after the flow finishes using ltng:outApp from visualforce? Is there a different approach that should be used?