Reputation: 146
I am trying use a Quick Action that launches a Flow and I'm getting the error
The action you specified isn’t available on the current record page.
Here is the Component Code:
<aura:component
implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickActionWithoutHeader,lightning:isUrlAddressable,force:appHostable,flexipage:availableForAllPageTypes"
<lightning:workspaceAPI aura:id="workspace" />
<lightning:quickActionAPI aura:id="quickActionAPI" />
<lightning:navigation aura:id="navService" />
<aura:handler name="refreshPage" event="force:refreshView" action="{!c.forceRefresh}" />
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="case" type="Object" />
<aura:attribute name="caseRecord" type="Case" default="{'sObjectType': 'Case'}" />
<force:recordData aura:Id="recordData" recordId="{!v.recordId}" mode="EDIT" targetRecord="{!v.case}"
targetFields="{!v.caseRecord}" recordUpdated="{!c.recordUpdated}"
fields="ID, OwnerId"/>
<div>
<lightning:button variant="brand" class="paylocity-orange" label="Tax Direct Request"
onclick="{!c.TaxDirectRequestClick}"/>
</div>
Here is the Controller code:
TaxDirectRequestClick : function(component, event, helper) {
debugger;
var actionAPI = component.find("quickActionAPI");
var recId = component.get("v.recordId");
var fields = { recordId : recId};
var args = {actionName: "Case.Escalation_Request",
entityName : "Case",
targetFields : fields };
actionAPI.selectAction(args).then(function(result){
actionAPI.invokeAction(args);
}).catch(function(e){
if(e.errors){
//If the specified action isn't found on the page, show an error message in the my component
console.log(e.errors);
}
});
The Escalation_Request quick Action Launches a Flow that accepts the Case ID in a variable named recordId
Upvotes: 0
Views: 24