Skip to content

Instantly share code, notes, and snippets.

@brianbier
Created November 19, 2019 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brianbier/20eeec6fd578cb0a90d667cc955af21d to your computer and use it in GitHub Desktop.
Save brianbier/20eeec6fd578cb0a90d667cc955af21d 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
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