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
Brian11Brian11 

How to fire global actions from a Lightning Component

I am trying to use a button inside a lightning component to open a global action. Is this possible?
 

Ultimately the behavior I am looking for is the slide up from bottom left that a global action has. I cant find anything in the docs that has this feature. I keep running into quickAction api and the utility Api.

 

<aura:component implements="force:appHostable, flexipage:availableForAllPageTypes, flexipage:availableForRecordHome, force:hasRecordId" access="global">

  <lightning:quickActionAPI aura:id="quickActionAPI" />

      <lightning:button label="Select Update Case Action" onclick="{!c.fireGlobal}" />


</aura:component>

// Controller
fireGlobal: function (cmp, event, helper) {
    var actionAPI = cmp.find("quickActionAPI");
   // New Contact is a global action
    var args = { actionName: "NewContact" };
    actionAPI.invokeAction(args);
}
Shruti SShruti S
What happens with the above code ? I have used the above to spawn Quick Actions. 
Brian11Brian11
Hey Shruti, 

Nothing happens. The global action doesnt fire. I am not sure if it only happens with quick action buttons and not global actions. 
If it worked for you would you mind sharing some example code? 
 
Josh Davis 41Josh Davis 41
Brian, ever figure this out? I tried with both global and object-specific quick actions.
Brian11Brian11
Hey @josh,

No I did not find a solution yet. Can you share your example?
Ramakrishna Reddy GouniRamakrishna Reddy Gouni
<aura:component implements="force:appHostable, flexipage:availableForAllPageTypes, flexipage:availableForRecordHome, force:hasRecordId" access="global">

  <lightning:quickActionAPI aura:id="quickActionAPI" />

      <lightning:button label="Select Update Case Action" onclick="{!c.fireGlobal}" />


</aura:component>

// Controller
fireGlobal: function (cmp, event, helper) {
    var actionAPI = cmp.find("quickActionAPI");
   // New Contact is a global action
    var args = { actionName: "Contact.NewContact" };
    actionAPI.invokeAction(args);
}
Narender Raju KurapatiNarender Raju Kurapati
Hi Brain , Have you found any solution to the probelm , Could you kindly share the sample code if you have found anything .  Apprciate your help , Thanks