0

Is there any way to capture the event of a Quick Action in LWC? The Quick Action is applied on a picklist that when pressed, the picklist takes "x" value.

This is the Quick Action in page:

enter image description here

And here is where it's created the Quick Action:

enter image description here

1
  1. LWC does not natively support Quick Actions
  2. When you are embedding it in an Aura Component you will still not be able to capture it - LWCs can only listen to CustomEvents
  3. You have to fire the close event due to 1) anyways from your aura component which means your setup will look like =>

    • Aura Wrapper embeds your LWC and listen on a event you define
    • LWC provide Markup and Logic
    • When Quick Action is done aka close it => fire custom event to wrapper cmp (and then you know already that it will be closed without listening on sth. else)
    • Aura Wrapper fires the old aura events to close quick action

Isolated LWCs which are just sitting directly somewhere on the page will not be able to do anything related to quick actions

if it is the case that you want to notify a separated LWC on Quick Action Close of an Aura Component (without using lwc for markup / logic) you may want to check the pub sub examples in the LWC Receipes Repo => in that case you are fireing in your Aura Component the Salesforce Application Event and additionally notifying subscribers via your pub sub component (to which the other lwc is listening)

2
  • i added some more info @Renji-xD
    – Alex M.
    Jul 2 '19 at 7:10
  • not sure what the screenshot should tell me ;) The core statement is still true - you are not able to catch any system / platform events directly in lwc. If you want to react to quick actions you have to build a aura component which implements the quick action interface and provides its logic and the logic for notifying other components. As per salesforce.stackexchange.com/questions/257371/… you are maybe able to catch events from the force-namespace but not sure if that is considered "best practice"
    – Renji-xD
    Jul 2 '19 at 16:53

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.