0

I am trying to initiate the SendEmail quick action from a button on my lightning record page. This seems to work for Account, but does not work for custom objects. Code is as follows

Component

<aura:component description="SendCandidateToOffice" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,flexipage:availableForRecordHome,force:hasSObjectName" access="global">
<lightning:quickActionAPI aura:id="quickActionAPI"/>
<!-- function is doInit, this will be automated in future from a custom quick action -->
<lightning:button value="{!this}" onclick="{!c.doInit}" label="initQa"/></aura:component>

Component

({
doInit : function(component, event, helper){
    var actionAPI = component.find("quickActionAPI");
    // check available actions
    actionAPI.getAvailableActions().then(function(result){
        console.log("AvailableActions => ", JSON.stringify(result));
    })
    .catch(function(err){
        console.error("ERROR => ", err);
    });

    var args = {actionName: "SendEmail", recordId: component.get("v.recordId")};
    actionAPI.selectAction(args).then(function(result){
        console.log("SendEmail => ", JSON.stringify(result));
    }).catch(function(err){
        console.error("ERROR args => ", err.errors);
    });
}});

When I execute this on the account record page, it opens the SendEmail action inside the activities component and the available actions get logged.

desired functionality

When I do this on a custom object record, the available actions don't get logged and I receive following error; "The action you specified isn’t available on the current record page."

'getAvailableActions()' doesn't seem to do anything, but the 'SendEmail' QuickAction is available on the record page.

enter image description here

What am I missing here?

0
1

This appears to be a part of the following known issue; https://success.salesforce.com/issues_view?id=a1p3A000001PYcdQAG

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.