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.

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

Note

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

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

Version 

Introduced in API version 29.0.

Fields 

default 

  • Type: boolean

  • Required: No

  • Description: 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 

  • Type: string
  • Required: No
  • Description: Optional description of the post template.

fields 

  • Type: string[]

  • Required: No

  • Description: 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 

  • Type: string
  • Required: Yes
  • Description: 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:

1<PostTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
2    <default>false</default>
3    <fields>NumberOfEmployees</fields>
4    <fields>NumberofLocations__c</fields>
5    <fields>PartnerAccount</fields>
6    <fields>LeadCustomFieldNumber__c</fields>
7    <label>My Lead Post Template</label>
8</PostTemplate>

The following is an example package manifest that references the previous PostTemplate component.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>Lead.leadtemplate</members>
5        <name>PostTemplate</name>
6    </types>
7    <version>29.0</version>
8</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.