+ Start a Discussion
Megha Mittal 19Megha Mittal 19 

Close a lightning quick action component in the initialize method


I have a requirement where on click on a lightning quick action, a mailto: command should run and the user should be able to view a mail option. 
I have added the mailto to a lightning component urlevent. once this is run, I want the quickaction modal to close. 
I have tried $A.get("e.force:closeQuickAction").fire() but the modal was still visible.
Can anyone tell me how to go ahead with this.
Raj VakatiRaj Vakati
Refer this link  .. 

sachin pawar 72sachin pawar 72
Create navigatecmp component

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:handler event="aura:doneRendering" action="{!c.handleClose}"/>
    <lightning:navigation aura:id="navService"/>


    doInit : function(component, event, helper) {
        var pageReference = {
            type: 'standard__component',
            attributes: {
                componentName: 'c__helloTarget',
            state: {
                "c__title": "John"
        const navService = component.find('navService');
        // const pageReference = component.get('v.pageReference');
        const handleUrl = (url) => {
            const handleError = (error) => {
            navService.generateUrl(pageReference).then(handleUrl, handleError);
    handleClose : function(component, event, helper) {