0

My handler component (recordCreate.cmp) isn't recognizing an application event for some reason, and generating this error as a result: No EVENT named markup://c:newEngagement found : [markup://c:recordCreate].

I've confirmed that this org has no namespace. Can anybody spot why the component isn't recognizing the event? Any help is much appreciated.

newEngagement.evt

<aura:event type="APPLICATION" description="Fired when User clicks overriden New Engagement button">
    <aura:attribute name="message" type="String"/>
</aura:event>

Firing Component & Controller (EngagementCreateOverride.cmp)

<aura:component implements="lightning:actionOverride,flexipage:availableForRecordHome" access="global">
    <aura:registerEvent name="newOppty" type="c:newEngagement"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>

({
    doInit : function(component, event, helper) {

        var createEngagementEvent = $A.get("e.c:newEngagement");
        createEngagementEvent.setParams({"message" : "some sample message"});
        createEngagementEvent.fire();
    }
})

Handler Component (recordCreate.cmp)

<aura:component implements="lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId" access="global">
    <aura:handler event="c:newEngagement" action="{!c.handleNewEngagement}"/>
    <aura:attribute name="recordId" type="String"/>
</aura:component>
  • This was a package.xml issue, hadn't named the event to be deployed. – Nicholas Zozaya Feb 11 at 21:48
0

Package.xml hadn't been revised to include newly created Event - once I included it in package.xml everything worked.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.