0

EDIT

I'm not sure if my question is clear, so I reformulate it : Is it possible to call an action (quick action for example) from a lightning component (in code) ?


I was wondering if, in a component that I create, I can put the edit button in the image below enter image description here

When I click this button it open the popup below : enter image description here

This button is in the lightning experience, and I'd like to put it in my code, is it possible or do I have to re-code it ?

1 Answer 1

1

I manage to do something like this following this steps.

Add Lightning Inspector Chrome Extension and record event log just before clicking the Edit Button.

There you can find which lightning event is firing the modal dialog.

Then, you could recreate it.

In my case, I was able to open select file dialog with this code :

({
    initializeFileDialog : function(component, event, helper) {
        var strFileDialogComponent = 'forceChatter:publisherSalesforceFileAction';

        $A.createComponent('markup://' + strFileDialogComponent , null, function(){}); 
    },    
    openFileDialog : function() {
        debugger;
        var strFileDialogComponent = 'forceChatter:publisherSalesforceFileAction';

        $A.createComponent('markup://' + strFileDialogComponent, null,
            function(objFileDialog) {
                objFileDialog.get('e.run').fire();
            }
        );
    }
})

enter image description here

3
  • I'm not sure to understand, could you put the code of the component corresponding with this controller ?
    – dou
    Mar 30, 2017 at 15:15
  • Yes, I put the initializeFileDialog on the init of the lightning component. openFileDialog is the handler of a onclick button event. (this code is inside the component's helper)
    – ransommule
    Mar 30, 2017 at 15:18
  • ok, but in fact you are forced to recreate the component, for example an edit button ? Is there a way to directly put the true component into a lightning component ?
    – dou
    Mar 30, 2017 at 15:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .