PostTemplate

Represents the metadata associated with an approval post template for Approvals in Chatter. With approval post templates, you can customize the information included in approval request posts that appear in Chatter feeds. This type extends the Metadata metadata type and inherits its fullName field.

Review Chatter Post Templates for Approval Requests in the Salesforce Help before you create a post template.

Note

File Suffix and Directory Location

PostTemplate components have the suffix .postTemplate and are stored in the postTemplates folder.

Version

PostTemplate components are available in API version 29.0 and later.

Fields

Field Name Field Type Description
default boolean Required. Specifies whether this is the default post template for the given object.

When set to true, this post template is used by approval processes that are associated with the same object and don’t specify a post template.

When an object has no default post template, each of its approval processes uses the system default post template, unless the approval process specifies its own post template.

description string Optional description of the post template.
fields string[] Required. An array of up to four fields to include in approval request posts.

If the approval object is a detail object in a master-detail relationship, Owner isn’t available for approval page layouts or approval post templates.

label string Required. Name of the post template. This non-unique label is different from the unique name of the post template.

Declarative Metadata Sample Definition

The following is an example of a PostTemplate component:

<PostTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
    <default>false</default>
    <fields>NumberOfEmployees</fields>
    <fields>NumberofLocations__c</fields>
    <fields>PartnerAccount</fields>
    <fields>LeadCustomFieldNumber__c</fields>
    <label>My Lead Post Template</label>
</PostTemplate>
The following is an example package manifest that references the previous PostTemplate component.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Lead.leadtemplate</members>
        <name>PostTemplate</name>
    </types>
    <version>29.0</version>
</Package>

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.