getCustomAction

Allows custom components to access a custom quick action and pass data or messages to it.

Arguments 

NameTypeDescription
actionNamestringThe name of the quick action that you want to access.

The actionName parameter starts with the Salesforce object, followed by the quick action name. For example:

1actionName: "Case.MyCustomAction"

Sample Code 

1actionApi.getCustomAction(args).then(function(customAction) {
2  if (customAction) {
3    customAction.subscribe(function(data) {
4      // Handle quick action message
5    });
6    customAction.publish({
7      message : "Hello Custom Action",
8      Param1 : "This is a parameter"
9    });
10  }
11}).catch(function(error) {
12  // We can't find that custom action.
13});

Response 

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

1success: boolean,
2customAction: {
3  subscribe: function,
4  publish: function,
5  unsubscribe: function
6},
7unavailableAction: boolean,
8errors: []