TimeSheetTemplate

Represents a template for creating time sheets in Field Service.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

TimeSheetTemplate components have the suffix timeSheetTemplate and are stored in the timeSheetTemplates folder.

Version 

Introduced in API version 46.0.

Special Access Rules 

Field Service must be enabled. Users must have the Customize Application and Time Sheet Template permissions.

Fields 

active 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the time sheet template is active (true) or not (false).

description 

  • Type: string
  • Required: No
  • Description: The time sheet template’s description.

frequency 

  • Type: TimeSheetFrequency (enumeration of type string)
  • Required: Yes
  • Description: Required. Defines the frequency of the time sheet creation period. One of the following values:
  • Possible values:
    • Daily
    • Weekly
    • EveryTwoWeeks
    • TwiceAMonth
    • Monthly

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. The name of the time sheet template.

startDate 

  • Type: date
  • Required: Yes
  • Description: Required. The date when the time sheet takes effect.

timeSheetTemplateAssignments 

workWeekEndDay 

  • Type: DaysOfWeek (enumeration of type string)
  • Required: Yes
  • Description: Required. The end day of the template’s work week. One of the following values:
  • Possible values:
    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday
    • Sunday

workWeekStartDay 

  • Type: DaysOfWeek (enumeration of type string)
  • Required: Yes
  • Description: Required. The start day of the template’s work week. One of the following values:
  • Possible values:
    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday
    • Sunday

TimeSheetTemplateAssignment Type 

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.

Fields 

assignedTo 

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