Newer Version Available

This content describes an older version of this product. View Latest

getAvailableActions

Allows custom components to get a list of the available actions on a record page.

Arguments

None.

Sample Code

1getAvailableActions : function( cmp, event, helper) {
2        var actionAPI = cmp.find("quickActionAPI");
3        actionAPI.getAvailableActions().then(function(result){
4            //All available actions shown;
5        }).catch(function(e){
6            if(e.errors){
7                //If the specified action isn't found on the page, show an error message in the my component 
8            }
9        });
10    }

Response

Returns a Promise. Success resolves to a response object. The Promise is rejected on error response.

1success: true,
2actions:
3    {actionName: "Case._LightningUpdateCase", recordId: "recordId", type: "QuickAction"}
4    {actionName: "FeedItem.TextPost", recordId: "recordId", type: "QuickAction"}
5    {actionName: "Case.LogACall", recordId: "recordId", type: "QuickAction"}
6    {actionName: "Case.SendEmail", recordId: "recordId", type: "QuickAction"}
7errors: []