Skip to content

Instantly share code, notes, and snippets.

@brianbier
Created November 19, 2019 20:41
Show Gist options
  • Select an option

  • Save brianbier/20eeec6fd578cb0a90d667cc955af21d to your computer and use it in GitHub Desktop.

Select an option

Save brianbier/20eeec6fd578cb0a90d667cc955af21d to your computer and use it in GitHub Desktop.

Revisions

  1. brianbier revised this gist Nov 19, 2019. No changes.
  2. brianbier renamed this gist Nov 19, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. brianbier created this gist Nov 19, 2019.
    45 changes: 45 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    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);
    });