0

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?

1 Answer 1

0

force:navigateToSObject is only available in select experiences:

This event is handled by the one.app container. It’s supported in Lightning Experience, the Salesforce mobile app, and Aura-based Experience Builder sites.

Note that Lightning Out is not a supported experience. Instead, just use window.location.href (or window.top.location.href if in an iframe).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .