I just started lightning component development. When i tried to fire an event from the page its not firing. Can somebody suggest me where i missed it. Here is my code. I just like to know where i missed it. I tried in all the possible ways but no luck. Can somebody tell me where i am missing. Thanks in advance.


<aura:component >
    <aura:attribute name="acc" type="Account" default="{sobjectType:'Account',
    <aura:registerEvent name="InsertAccount" type="c:DMLEvent" description="Fire an DML event on saving the record"/>
    <lightning:layout >
        <lightning:layoutItem >
            <lightning:input type="text" label="Name" value="{!v.acc.Name}" name="nameOfAcc"/>
            <lightning:input type="text" label="Description" value="{!v.acc.Description}" name="des"/>
            <lightning:button type="button" label="Save Account" onclick="{!c.saveAccount}" />

Component Controller:

    saveAccount : function(component, event, helper) {
        var initializeDMLInfo =$A.get('e.c:DMLEvent');


<aura:event type="APPLICATION" description="Event template" >
    <aura:attribute name="sObjectInfo" type="Sobject" />

Event Handler Component:

<aura:component >
    <aura:handler name="handleEvent" event="c:DMLEvent" action="{!c.doDML}" />

Event Handler Components Controller:

    doDML : function(component, event, helper) {

2 Answers 2


There are 1 or 2 events in your code but from what i understand you are firing an application event. Application event handlers cannot have the name attribute so remove the name attribute from event handler component

The handler for an application event won’t work if you set the name attribute in <aura:handler>. Use the name attribute only when you’re handling component events.

<aura:component >
    <aura:handler event="c:DMLEvent" action="{!c.doDML}" />
  • Here is my updated component. I am still not able to fire the event.<aura:component > <aura:handler event="c:DMLEvent" action="{!c.doDML}" /> </aura:component> Mar 17, 2018 at 16:19
  • @AbhinaySaripalli, Are you not able to fire the event or is the handler not getting invoked?
    – RedDevil
    Mar 17, 2018 at 16:43

Got the answer. Problem is my Event Handler component i didnt specify in my Lightning app. We have to specify all our components which are going to communicate in our application in the Lightning app, then only they can know each other and can able to fire.

Before changes :

<aura:application extends="force:slds" >
    <c:AccountCapture />

After changes:

<aura:application extends="force:slds" >
    <c:AccountCapture />
    <c:DMLComponent />

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .