I'm trying to open the Note editor from a custom button on the Event record. Based on this current solution I have created a new Aura component that is called on button press. The aura first inserts a Note record in DB and return the Id of the note back to the helper. It is then supposed to use that Id in order to call the open note event that SF provides. My helper looks like:
({
createNewNote : function(cmp){
var that = this;
var action = cmp.get("c.insertNewNote");
action.setParams({"parentId": cmp.get("v.recordId")});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
cmp.set("v.newNoteId", response.getReturnValue());
console.log(cmp.get('v.newNoteId'));
that.editNote(cmp, response.getReturnValue());
}
else {
console.log("Failed with state: " + state);
}
});
$A.enqueueAction(action);
},
editNote : function(cmp, noteId) {
console.log('in evt', noteId);
var editEvent = $A.get("e.notes:editNote")
console.log(editEvent);//this is undefined
editEvent.setParams({
"noteId": noteId
});
editEvent.fire();
}
})
Problem is that this line $A.get("e.notes:editNote") is undefined and I get an error when I try to set the parameters.
I have already tried calling the action like window.$A.get("e.notes:editNote") but without any success.
Also I made sure that the event exists. When I call window.$A.get("e"); in chrome console I can find it as it follows
I have also tried different variants of getting the event in the console, but I only get undefined. Is there a way to call this event?