I would like to launch a Flow instead of the standard "NewCase" button to create a Case. I have followed some instructions to create a Lightning Aura Component to launch the Flow in a modal, and I have selected the component to be used as the override, but when I click the "New" button, the regular Salesforce Lightning Record Page opens.
The ONLY thing I can think of is that because I have dynamic forms enabled, it is refusing to use the override the New button. However I tried unassigning my lightning page entirely from everything, and it still doesn't work - it just defaults to using the page layout.
Here's my component:
<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId,lightning:actionOverride,flexipage:availableForRecordHome">
<lightning:overlayLibrary aura:id="overlayLib"/>
<lightning:button label="Create Case" onclick="{!c.launchFlow}" />
</aura:component>
Controller:
({
launchFlow : function(component, event, helper) {
var flowName = "Create_Case";
var flow = component.find("createCaseFlow");
var overlayLib = component.find('overlayLib');
overlayLib.showCustomModal({
header: "Create Case",
body: flow,
showCloseButton: true,
cssClass: "my-modal",
closeCallback: function() {
// Handle modal close event if necessary
}
}).then(function(overlay) {
// Code to handle overlay promise if necessary
});
flow.startFlow(flowName);
},
})
Override Settings: