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
Sheryl JohnsonSheryl Johnson 

Redirect Action Flow to URL

I am not a programmer, but I usually can deconstruct examples well enough to adapt.   Anyway, I am launching a flow as a lightning action button for a custom object called Program.  The flow performs several actions before deleting the record the user is on when calling the flow.  After the flow finishes, Salesforce is staying on the deleted record page which of course now doesn't exist.  If the user refreshes the screen, they get an error message.   

I originally was calling the flow with a URL and then I could include a return URL to the custom object list view.  But I really prefer the flow as a lighting action so it runs in an overlay window. 

I did find this page (https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_implementation_guide.meta/salesforce_vpm_implementation_guide/vpm_admin_onfinish.htm#!) that talks about embedding the flow in a visualforce page, but then I'm not sure how to then call the flow as an action.  Here's the code of the page Visualforce page I created in Developer.

1<apex:page>
2<flow:interview name="Delete_Program_Screen_Flow" finishLocation="{!URLFOR('/home/home.jsp')}"/>
3</apex:page>

I also saw references to creating an aura component that I could then call as a final core action in my flow, but I don't know enough about aura to undersand how to create the controller to go along with it. 

<aura:component implements="lightning:availableForFlowActions" >
    gotoURL : function (component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": "/a0m/o"
    });
    urlEvent.fire();
}
</aura:component>

Would appreciate any insight folks could give me into making either of these solutions work, or if there is a better/easier way to go.

Thanks!
Sheryl JohnsonSheryl Johnson
Ok, I got a step closer using the Visualforce page option.  I created a global action that launched that visualforce page which I could then add to my Program layout as a lighting action.  Problem is, it is rendering it in classic for starters (and I also have multiple sets of navigation buttons.)

What am I missing?

User-added image