3

I have a simple lightning component that I use as a quick action. I want to create another lightning component as a new custom quick action. Can I invoke the new quick action from the old one?

The reason I want to do this is to separate functionality allowing users to run the new quick action alone or the old quick action which will automatically invoke the new one.

closed as unclear what you're asking by crmprogdev, Santanu Boral, Eric, Ratan Paul, Martin Lezer Jun 5 '17 at 7:09

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Obviously you can invoke a quick action from a custom lightning component. However, as written, your question doesn't make any sense to me if you're asking "can I invoke my new quick action from my old one?" Please show your code or pseudo code to be more clear on what you're asking. It seems obvious that you can edit your existing quick action to call the new component. – crmprogdev Jun 3 '17 at 14:01
  • I just have two components that implement force:lightningQuickAction. Both are object-specific quick actions which can be invoked with buttons through the UI. My question is how would I go about invoking one quick action through JavaScript by the other quick action (which is a lightning component). – Said Al Attrach Jun 4 '17 at 15:51
3

According to the documentation, you can invoke Quick Actions both via Apex and REST API.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_quickaction_quickactionrequest.htm

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_quickactions.htm

However, I do not think there is a base Lightning Component that simply invokes or opens one in UI.

You could possibly have your Lightning Component's Apex controller invoke the new Quick Action, passing in data your old Lightning Component collects from the user.

  • Oh alright.. what's not clear to me is why I would to this from Apex, since this is supposed to be the "backend", whereas the quick action would bring up a dialog that the user interacts with. So it would make more sense to me if I could fire an event in JavaScript that would bring up this dialog. I'm quite new to SalesForce development; maybe I'm thinking about it the wrong way. I appreciate your answer though! Will give it a try.. – Said Al Attrach Jun 4 '17 at 15:44
  • 3
    I agree, and I've raised this with the product managers. They agree but it has to get prioritized among other work coming down the pipe. So maybe in the next release or two we might see something – Doug Ayers Jun 4 '17 at 15:55

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