Newer Version Available
TimeSheetTemplate
File Suffix and Directory Location
TimeSheetTemplate components have the suffix timeSheetTemplate and are stored in the timeSheetTemplates folder.
Version
TimeSheetTemplate components are available in API version 46.0 and later.
Special Access Rules
Field Service must be enabled. Users must have the Customize Application and Time Sheet Template permissions.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| active | boolean | Required. Indicates whether the time sheet template is active (true) or not (false). |
| description | string | The time sheet template's description. |
| frequency | TimeSheetFrequency (enumeration of type string) | Required. Defines the frequency of the time sheet creation period. One of the
following values:
|
| masterLabel | string | Required. The name of the time sheet template. |
| startDate | date | Required. The date when the time sheet takes effect. |
| timeSheetTemplateAssignments | TimeSheetTemplateAssignment | A list of profiles that the template is assigned to. |
| workWeekEndDay | DaysOfWeek (enumeration of type string) | Required. The end day of the template's work week. One of the following values:
|
| workWeekStartDay | DaysOfWeek (enumeration of type string) | Required. The start day of the template's work week. One of the following values:
|
TimeSheetTemplateAssignment
Returns a quick action that’s associated with an EmbeddedServiceLiveAgent setup. The quick action includes the pre-chat form fields that the embedded chat window displays and shows the order in which the fields are displayed.
| Field Name | Field Type | Description |
|---|---|---|
| assignedTo | string | The IDs of the user profiles that a time sheet template is assigned to. |
Declarative Metadata Sample Definition
The following is an example of a TimeSheetTemplate file.
1<?xml version=“1.0” encoding=“UTF-8"?>
2<TimeSheetTemplate xmlns=“http://soap.sforce.com/2006/04/metadata“>
3 <active>true</active>
4 <description>Time Sheet Template description</description>
5 <frequency>Daily</frequency>
6 <masterLabel>label</masterLabel>
7 <startDate>2018-10-18</startDate>
8 <timeSheetTemplateAssignments>
9 <assignedTo>admin</assignedTo>
10 </timeSheetTemplateAssignments>
11 <timeSheetTemplateAssignments>
12 <assignedTo>standard</assignedTo>
13 </timeSheetTemplateAssignments>
14 <workWeekEndDay>Tuesday</workWeekEndDay>
15 <workWeekStartDay>Monday</workWeekStartDay>
16</TimeSheetTemplate>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>TimeSheetTemplate</name>
6 </types>
7 <version>46.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.