[SalesForce] How to open Local or Global quick action from custom lightning component

In Winter 17 Salesforce allows creating custom lightning quick actions and have associated interfaces and an event to close the quick action. I wonder if it is possible to invoke the quick action from custom lightning component directly?

Best Answer

Actually it is not even possible to open it through Apex code.

I created two actions. Lightning Action on Account and called it LA and Visualforce action on Account and called it VA.

When I try to execute this code

QuickAction.QuickActionRequest req = new QuickAction.QuickActionRequest();
req.quickActionName = 'Account.LA';
req.contextid = '001xx000003DGcO';
System.debug(LoggingLevel.ERROR, '@@@ req: ' + req );
QuickAction.QuickActionResult res = QuickAction.performQuickAction(req);
System.debug(LoggingLevel.ERROR, '@@@ res: ' + res );

I receive an error

System.UnexpectedException: ActionType LightningComponent not supported yet

and when I try to execute this code

QuickAction.QuickActionRequest req = new QuickAction.QuickActionRequest();
req.quickActionName = 'Account.LA';
req.contextid = '001xx000003DGcO';
System.debug(LoggingLevel.ERROR, '@@@ req: ' + req );
QuickAction.QuickActionResult res = QuickAction.performQuickAction(req);
System.debug(LoggingLevel.ERROR, '@@@ res: ' + res );

I receive an error

System.UnexpectedException: ActionType VisualforcePage not supported yet

So it is not only unavailable directly from Lightning, but it is also unavailable through Apex

Related Topic