-
-
Save lukaszhanusik/8bb8297970d8076b5d06706029ec850b to your computer and use it in GitHub Desktop.
All possible Options for creating an event, Since It doesn't work for regular lightning components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.open('/lightning/o/Event/new'); | |
var urlEvent = $A.get("e.force:navigateToURL"); | |
urlEvent.setParams({ | |
"url": "/lightning/o/Event/new" | |
}); | |
urlEvent.fire(); | |
var createRecordEvent = $A.get("e.force:createRecord"); | |
createRecordEvent.setParams({ | |
"entityApiName": "Event", | |
"defaultFieldValues": { | |
'Change_Machine_Event__c': true | |
} | |
}); | |
createRecordEvent.fire(); | |
const actionApi = component.find('quickActionAPI'); | |
// const args = { entityName: 'Contact', actionName: 'budget' }; | |
const args = { actionName: "Contact.Trigger_meetin"}; | |
actionApi.selectAction(args) | |
.then(() => { | |
console.log('im here now') | |
// actionApi.invokeAction(args); | |
}) | |
.catch(error => { | |
console.log(JSON.stringify(error)); | |
}); | |
actionApi.getCustomAction(args).then(function (customAction) { | |
console.log('customAction',JSON.stringify(customAction)) | |
if (customAction) { | |
customAction.subscribe(function (data) { | |
// Handle quick action message | |
}); | |
customAction.publish({ | |
message: "Hello Custom Action", | |
Param1: "This is a parameter" | |
}); | |
} | |
}).catch(function (error) { | |
// We can't find that custom action. | |
console.log('the error would fire',error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment