Newer Version Available

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

ActionLinkGroupTemplate

Represents the action link group template. Action link templates let you reuse action link definitions and package and distribute action links. An action link is a button on a feed element. Clicking on an action link can take a user to another Web page, initiate a file download, or invoke an API call to an external server or Salesforce. Use action links to integrate Salesforce and third-party services into the feed. Every action link belongs to an action link group and action links within the group are mutually exclusive. This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

ActionLinkGroupTemplate components have the suffix .actionLinkGroupTemplate and are stored in the actionLinkGroupTemplates folder.

Version

ActionLinkGroupTemplate components are available in API version 33.0 and later.

Fields

Field Name Field Type Description
actionLinkTemplates ActionLinkTemplate[] Action link templates that are associated with the action link group template.
category PlatformAction​GroupCategory (enumeration of type string) Required. The location of the action link group within the feed element. Values are:
  • Primary—The action link group is displayed in the body of the feed element.
  • Overflow—The action link group is displayed in the overflow menu of the feed element.
executionsAllowed ActionLink​ExecutionsAllowed (enumeration of type string) Required. The number of times an action link can be executed. Values are:
  • Once—An action link can be executed only once across all users.
  • OncePerUser—An action link can be executed only once for each user.
  • Unlimited—An action link can be executed an unlimited number of times by each user. You can’t use this value if the action link’s actionType is Api or ApiAsync.
hoursUntilExpiration int Required. The number of hours from when the action link group is created until it's removed from associated feed elements and can no longer be executed. The maximum value is 8,760.
isPublished boolean Required. If true, the action link group template is published. Action link group templates shouldn’t be published until at least one action link template is associated with it.
name string Required. The name of the action link group template to use in code.

ActionLinkTemplate

ActionLinkTemplate components are used to create multiple action links that share properties.

Field Name Field Type Description
actionUrl string Required. The action link URL. For example, for a Ui action link, the URL may be a Web page. For a Download action link, the URL is a link to the file to download. Ui and Download action link URLs are provided to clients. For an Api or ApiAsync action link, the URL may be a REST resource. Api and ApiAsync action link URLs aren’t provided to clients.

Links to resources hosted on Salesforce servers can be relative, starting with a /. All other links must be absolute and start with https://. This field can contain context variables and binding variables in the form {!Bindings.key}, for example, https://www.example.com/{!Bindings.itemId}. Set the binding variable’s value when you instantiate the action link group from the template.

headers string Template for the HTTP headers sent when corresponding action links are invoked. This field can be used only for Api and ApiAsync action links. This field can contain context variables and binding variables in the form {!Bindings.key}.
isConfirmationRequired boolean Required. If true, a confirmation dialog appears before the action is executed.
isGroupDefault boolean Required. If true, action links derived from this template are the default or primary action in their action groups. There can be only one default action per action group.
labelKey string Required. Key for the set of labels to display for these states: new, pending, success, failed. For example, the Approve set contains these labels: Approve, Pending, Approved, Failed. For a complete list of keys and labels, see Action Links Labels in Chatter REST API Developer’s Guide..
linkType ActionLinkType (enumeration of type string) Required. The type of action link. One of these values:
  • Api—The action link calls a synchronous API at the action URL. Salesforce sets the status to SuccessfulStatus or FailedStatus based on the HTTP status code returned by your server.
  • ApiAsync—The action link calls an asynchronous API at the action URL. The action remains in a PendingStatus state until a a third-party makes a request to /connect/action-links/actionLinkId to set the status to SuccessfulStatus or FailedStatus when the asynchronous operation is complete.
  • Download—The action link downloads a file from the action URL.
  • Ui—The action link takes the user to a Web page at the action URL.
method ActionLink​HttpMethod (enumeration of type string) Required. HTTP method for the action URL. One of these values:
  • HttpDelete—Returns HTTP 204 on success. Response body or output class is empty.
  • HttpGet—Returns HTTP 200 on success.
  • HttpHead—Returns HTTP 200 on success. Response body or output class is empty.
  • HttpPatch—Returns HTTP 200 on success or HTTP 204 if the response body or output class is empty.
  • HttpPost—Returns HTTP 201 on success or HTTP 204 if the response body or output class is empty. Exceptions are the batch posting resources and methods, which return HTTP 200 on success.
  • HttpPut—Return HTTP 200 on success or HTTP 204 if the response body or output class is empty.

Ui and Download action links must use HttpGet.

position int Required. An integer specifying the position of the action link template relative to other action links in the group. 0 is the first position.
requestBody string Template for the HTTP request body sent when corresponding action links are invoked. This field can be used only for Api and ApiAsync action links. This field can contain context variables and binding variables in the form {!Bindings.key}.
userAlias string If you selected CustomUser or CustomExcludedUser for UserVisibility, this is the alias for the custom user. Use the alias in a template binding to specify the custom user when an action link group is created using the template.
userVisibility ActionLink​UserVisibility (enumeration of type string) Required. Who can see the action link. Note that this value is set per action link, not per action link group. Values are:
  • Creator—Only the creator of the action link can see the action link.
  • Everyone—Everyone can see the action link.
  • EveryoneButCreator—Everyone but the creator of the action link can see the action link.
  • Manager—Only the manager of the creator of the action link can see the action link.
  • CustomUser—Only the custom user can see the action link.
  • CustomExcludedUser—Everyone but the custom user can see the action link.

Declarative Metadata Sample Definition

The following is an example of an ActionLinkGroupTemplate component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ActionLinkGroupTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
3   <actionLinkTemplates>
4      <actionUrl>/services/data/{!Bindings.word}/chatter/feed-elements</actionUrl>
5      <headers>Content-Type:{!Bindings.word3}</headers>
6      <isConfirmationRequired>true</isConfirmationRequired>
7      <isGroupDefault>true</isGroupDefault>
8      <labelKey>Add</labelKey>
9      <linkType>API</linkType>
10      <method>httpPost</method>
11      <position>0</position>
12      <requestBody>{"body":{"messageSegments":[{"type": "Text",
13      "text": "{!Bindings.word1}"}]},"subjectId": "{!Bindings.word2}",
14      "feedElementType": "feedItem"}</requestBody>
15      <userAlias>customExcludedUser</userAlias>
16      <userVisibility>CustomExcludedUser</userVisibility>
17   </actionLinkTemplates>
18   <category>Primary</category>
19   <executionsAllowed>OncePerUser</executionsAllowed>
20   <hoursUntilExpiration>10</hoursUntilExpiration>
21   <isPublished>true</isPublished>
22   <name>MyPackage</name>
23</ActionLinkGroupTemplate>
The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>*</members>
5        <name>ActionLinkGroupTemplate</name>
6    </types>
7    <version>33.0</version>
8</Package>

Usage

If you modify action link group templates, you overwrite the related action link templates.

If you delete a published action link group template, you delete all related action link information which includes deleting all action links that were instantiated using the template from feed items.