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
Ragnar Lothbrok 7Ragnar Lothbrok 7 

Two modal appears on quick action button click

HI All,
I have created an aura component that actually calls the send email global action to send an email.
Then on order object i created an action and called that aura component on that action button.
But when we click on button on record page its appears two modal one with Email and in background modal with header and cancel button.
I dont know how to remove then or eleminate the background modal that is of no use.
.cmp file
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes,force:lightningQuickAction">
    <!--Handler-->
    <lightning:navigation aura:id="navService"/>
    <lightning:pageReferenceUtils aura:id="pageRefUtil"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    
</aura:component>

.js file
({
    doInit: function (cmp, event, helper) {
        var navService = cmp.find("navService");
        // var actionApiName = event.getSource().get('v.value');
        var actionApiName = "Global.SendEmail";
        var pageRef = {
            type: "standard__quickAction",
            attributes: {
                apiName : actionApiName
            },
            state: {
                recordId : cmp.get("v.recordId")
            }
        };
        var defaultFieldValues = {
            HtmlBody: "Monthly Review",
            Subject : "Monthly Review"
        }
        pageRef.state.defaultFieldValues = cmp.find("pageRefUtil").encodeDefaultFieldValues(defaultFieldValues);
    
        navService.navigate(pageRef);
    },

    doneRendering: function(cmp, event, helper) {
        $A.get("e.force:closeQuickAction").fire();
    }
})

 
AnkaiahAnkaiah (Salesforce Developers) 
Hi Rangar,

Refer the below link and modify your code.
https://hicglobalsolutions.com/blog/send-emails-templates-lightning-component/

Thanks!!
Ragnar Lothbrok 7Ragnar Lothbrok 7
Hi  Ankaiah ,
The above component is working fine, 
the question i have is when i click on the quick action button it opens up the modal(2 modals) one in background and other in foreground
The foreground modal show the email action correctly, but i dont know why ot shows the background modal
I wanted to know how can we eliminate it