Tags

,

Recently, as part of Summer 21 release, Salesforce has given us an option to call the LWC directly from the Quick Action, earlier we had to call Lightning Component(LC) from the Quick Action and call the LWC from LC.

In my current project, I had created a Quick Action called “Edit” and to close the Quick Action when user clicks on Cancel button inside the modal, we had to do the following:

import { CloseActionScreenEvent } from ‘lightning/actions’;

Let’s say the method closeModal is called, when user clicks on Cancel button:

closeModal() {

this.dispatchEvent(new CloseActionScreenEvent());

}

To create the modal when user clicks on Edit button, we have not used lightning-quick-action-panel component(Beta) and used Modals blueprint in SLDS. Please refer the above link for creating a Quick Action and calling the LWC from it:

https://developer.salesforce.com/blogs/2021/05/learn-moar-with-summer-21-lwc-quick-actions

Documentation for the lightning-quick-action-panel is available in the below link:

https://developer.salesforce.com/docs/component-library/bundle/lightning-quick-action-panel/documentation

Thanks and see you all at the next post!!

P.S: Tried Anchor PodCast tool for this blog post:) and here is the link https://anchor.fm/manibalan-sampathkumar/episodes/How-to-Close-Quick-action-in-LWC-e15j8ta

Advertisement