Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

performQuickActions()

Executes quick actions of type create or update.

Syntax

1PerformQuickActionResult[] = connection.performQuickActions(PerformQuickActionRequest PerformQuickActionRequest[]);

Usage

Use the performQuickActions() call to perform a specific quick action. Returns an array of PerformQuickActionResult objects.

In API version 46.0 and later, the apiName for a global quick action can include the prefix Global. in a performQuickActions() request body. The request body also accepts global quick action API names without the prefix.

Note

If you’re accessing the API using a custom community URL and you use the performQuickActions() call to create a group, the group is only available within that community.

Note

The OutgoingEmail entity can be created only via calls from the performQuickAction API.

Note

Sample—Java

This sample uses a quick action to create a new contact.

1public void example() throws Exception {
2        
3    PerformQuickActionRequest req = new PerformQuickActionRequest();
4        
5    Contact con = new Contact();
6    con.setLastName("Smith");
7        
8    req.setQuickActionName("Account.QuickCreateContact");
9    req.setParentId("001D000000JSaHa");
10/* For version 29.0 and greater, use setContextId */
11    req.setRecords(new SObject[] { con });  //you can only save one record here
12    PerformQuickActionResult[] pResult = 
13        conn.performQuickActions(new PerformQuickActionRequest[] { req } );
14    for(PerformQuickActionResult pr : pResult) { 
15        assert pr.getSuccess();
16        assert pr.getCreated();
17        assert pr.getErrors().length == 0;
18        System.out.println("Id of the record created: " + pr.getIds()[0]);
19        System.out.println("Id of the feeditem for action performed: " + 
20            pr.getFeedItemIds()[0]);
21    }
22}

Arguments

Name Type Description
quickActions PerformQuickActionRequest The action request to perform.

PerformQuickActionRequest

Name Type Description
parentOrContextId ID
  • In API version 28.0, parentId is the ID of the sObject on which to create a record for the request.
  • In API version 29.0 and greater, contextId is the ID of the context on which to create a record for the request.
quickActionName string The parent or context sObject and action name—for example, Opportunity.QuickCreateOpp.
records SObject[] The record to be created. Only one record can be saved at a time.