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: 0: [{actionName:"Case._LightningUpdateCase", recordId:"500xx0000000006AA", type: “QuickAction”}
3         1: {actionName: “FeedItem.TextPost”, recordid: “500xx0000000006AA”, type: “QuickAction”}]