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
min Chen 9min Chen 9 

lightning component:override: create new event

hi,guys, a developer beginner here
i try to override a new event creation button with the standard new and save fuction but failed,
could some body tell me what is wrong with the save part, i cannot save properly.

<aura:component implements="lightning:actionOverride">
  <aura:handler name="init"  value="{!this}"  action="{!c.createAccount}"/>  
</aura:component>

({
 createAccount: function (component) {
     
        var createRecordEvent = $A.get('e.force:createRecord');
        if ( createRecordEvent ) {
             
            createRecordEvent.setParams({
                'entityApiName': 'Event'
            });
            createRecordEvent.fire();
        } else {
            /* Create Record Event is not supported */
            alert("Event creation not supported");
        }
    }
})