TimeSheetTemplate defines a template for creating time sheets in Field Service. It controls activation, the effective date, the creation period, work-week boundaries, and profile assignments. It represents template configuration, not the time sheet records created from that configuration.
The component inherits fullName as its metadata identity. Its required masterLabel supplies the template name. Profile assignments identify which profiles the template is assigned to; they are separate from the permissions required to access the template configuration.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
Inherited metadata identity of the component, distinct from its template name. |
masterLabel |
Required name of the time sheet template. |
active |
Required boolean. Indicates whether the template is active: true or false. |
startDate |
Required date when the template takes effect. This is separate from activation status. |
frequency |
Required time sheet creation period. Allowed values are Daily, Weekly, EveryTwoWeeks, TwiceAMonth, and Monthly. |
workWeekStartDay |
Required start day of the template's work week. Allowed values are Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. |
workWeekEndDay |
Required end day of the template's work week. Uses the same day-name values as workWeekStartDay. |
timeSheetTemplateAssignments |
Contains nested TimeSheetTemplateAssignment entries that assign the template to profiles. |
assignedTo |
Profile reference within each assignment entry. Its documented identifier format conflicts with the metadata example; resolve each value to the intended destination profile. |
Behavior and Constraints
Field Service must be enabled. Users must have both the Customize Application and Time Sheet Template permissions. Assigning a template to a profile does not replace these access prerequisites.
Interpret active and startDate together. The first indicates whether the template is active; the second specifies when it takes effect. Both fields are required and describe separate aspects of applicability.
frequency defines the time sheet creation period. EveryTwoWeeks and TwiceAMonth are distinct choices, not interchangeable labels.
Both work-week boundary fields are required independently of frequency. Choosing Daily or Monthly, for example, does not make workWeekStartDay or workWeekEndDay optional. The weekday values in the metadata example are examples, not defaults.
Each nested assignment points to a profile, not an individual user. Multiple timeSheetTemplateAssignments entries can appear in the template, each containing its own assignedTo value.
Deployment and Retrieval
Components use the .timeSheetTemplate suffix and reside in the timeSheetTemplates folder. In package.xml, use TimeSheetTemplate as the type name. The type supports the wildcard member *, allowing a manifest to request all components of this type.
For a destination org, account for Field Service enablement, the required permissions, and the intended profile assignments. The profile assignment values need particular attention: the field description calls them profile IDs, while the metadata example uses admin and standard.
Do not treat record IDs and profile names as interchangeable, or assume that an assignedTo value can be copied unchanged between orgs. Resolve the actual values to the intended destination profiles when interpreting the deployment.
Relationships
The template connects to profiles through assignedTo inside the nested TimeSheetTemplateAssignment structure. These entries belong to the template's timeSheetTemplateAssignments collection; they represent profile assignments rather than user assignments.
References
-
Profile:assignedTo, withintimeSheetTemplateAssignments.
Documentation Inconsistencies
-
Assignment identifier format is ambiguous. The
assignedTodescription specifies profile IDs, but the XML example usesadminandstandard. The example does not establish that record IDs and profile names are interchangeable or portable between orgs. -
The nested assignment introduction describes unrelated functionality. The introductory text for
TimeSheetTemplateAssignmentdiscusses an Embedded Service chat quick action and pre-chat fields. That text does not match the parent field, theassignedTodefinition, or the XML example, which describe time sheet template assignments to profiles.
Reported Issues
-
Apex SOQL was reported as unavailable for these types. A 2021 community inventory listed
TimeSheetTemplateandTimeSheetTemplateAssignmentas absent from the ApexSchemanamespace and not queryable in Apex. This report concerns Apex query access, not Metadata API retrieval support. See the discussion of Tooling API objects and Apex queries.
Common Questions
How do I retrieve all TimeSheetTemplate components?
Use TimeSheetTemplate as the type name and * as the member in package.xml. Component files use the .timeSheetTemplate suffix in the timeSheetTemplates folder.
What permissions are required to access time sheet templates?
Field Service must be enabled, and users must have both Customize Application and Time Sheet Template. These requirements are separate from the template's profile assignments.
Are work-week days required for a Daily template?
Yes. Both workWeekStartDay and workWeekEndDay are required independently of frequency, including when it is Daily.
Does assignedTo contain a user ID or a profile reference?
It references a profile, not an individual user. The documentation describes profile IDs but shows admin and standard in its example, so resolve the value to the intended destination profile rather than assuming an identifier format.
Are EveryTwoWeeks and TwiceAMonth the same frequency?
No. They are separate allowed values of frequency and must not be treated as interchangeable labels.