BusinessHoursSettings

Represents the metadata used to manage settings for business hours and holidays in entitlements, entitlement templates, campaigns, and cases.

In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for details.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

Business hours and holidays settings are stored in a single file named businessHours.settings in the settings directory. The .settings files are different from other named components because there’s only one settings file for each settings component.

Version 

Introduced in API version 29.0.

Fields 

businessHours 

  • Type: BusinessHoursEntry[]
  • Required: No
  • Description: Represents the application of business hours to entitlements, entitlement templates, campaigns, and cases.

holidays 

  • Type: Holiday[]
  • Required: No
  • Description: Represents a holiday and its usage in businessHours.

BusinessHoursEntry Type 

Represents the application of business hours to entitlements, entitlement templates, campaigns, and cases.

Parent Type 

This type extends Metadata and inherits its fields.

Fields 

active 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the business hours are active.

default 

  • Type: boolean
  • Required: Yes
  • Description: Indicates whether the business hours are used as the default business hours.

fridayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Friday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Friday.

fridayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Friday. Uses the format HH:mm:ss.SSSZ.

mondayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Monday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Monday.

mondayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Monday. Uses the format HH:mm:ss.SSSZ.

name 

  • Type: string
  • Required: No
  • Description: Name of the business hours. This name should be unique.

saturdayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Saturday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Saturday.

saturdayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Saturday. Uses the format HH:mm:ss.SSSZ.

sundayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Sunday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Sunday.

sundayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Sunday. Uses the format HH:mm:ss.SSSZ.

thursdayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Thursday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Thursday.

thursdayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Thursday. Uses the format HH:mm:ss.SSSZ.

timeZoneId 

  • Type: string
  • Required: No
  • Description: The time zone for the time that defines business hours.

tuesdayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Tuesday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Tuesday.

tuesdayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Tuesday. Uses the format HH:mm:ss.SSSZ.

wednesdayEndTime 

  • Type: xsd:time
  • Required: No
  • Description: End time for the business hours on Wednesday. Uses the format HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight on Wednesday.

wednesdayStartTime 

  • Type: xsd:time
  • Required: No
  • Description: Start time for the business hours on Wednesday. Uses the format HH:mm:ss.SSSZ.

Holiday Type 

Fields 

activityDate 

  • Type: date
  • Required: No

businessHours 

  • Type: string[]
  • Required: No

description 

  • Type: string
  • Required: No
  • Description: A description of this component. The description should explain the component’s purpose and behavior so that administrators and developers understand when to use it.

endTime 

  • Type: xsd:time
  • Required: No

isRecurring 

  • Type: boolean
  • Required: No

name 

  • Type: string
  • Required: No

recurrenceDayOfMonth 

  • Type: int
  • Required: No

recurrenceDayOfWeek 

  • Type: string[]
  • Required: No

recurrenceDayOfWeekMask 

  • Type: int
  • Required: No

recurrenceEndDate 

  • Type: date
  • Required: No

recurrenceInstance 

  • Type: string
  • Required: No

recurrenceInterval 

  • Type: int
  • Required: No

recurrenceMonthOfYear 

  • Type: string
  • Required: No

recurrenceStartDate 

  • Type: date
  • Required: No

recurrenceType 

  • Type: string
  • Required: No

startTime 

  • Type: xsd:time
  • Required: No

Holidays Type 

Represents a holiday and its usage in businessHours.

Fields 

activityDate 

  • Type: string
  • Required: No
  • Description: The date of the holiday. Use for non-recurring holidays. Uses the format HH:mm:ss.SSSZ.

businessHours 

  • Type: string
  • Required: No
  • Description: The name of the business hours setting that applies to this holiday.

description 

  • Type: string
  • Required: No
  • Description: The description of the holiday.

endTime 

  • Type: string
  • Required: No
  • Description: The end time on the date of the holiday. Uses the format HH:mm:ss.SSSZ. startTime and endTime must be both null or both not null. If they are both null, indicates the whole day.

isRecurring 

  • Type: string
  • Required: No
  • Description: Indicates whether the holiday is recurring.

name 

  • Type: string
  • Required: No
  • Description: Name of the holiday. This name does not have to be unique.

recurrenceDayOfMonth 

  • Type: string
  • Required: No
  • Description: The day of month the holiday recurs. Valid values: integers 1-31.

recurrenceDayOfWeek 

  • Type: string
  • Required: No
  • Description: The day of week the holiday recurs. Valid values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.

recurrenceEndDate 

  • Type: string
  • Required: No
  • Description: The date the holiday stops recurring. Uses the format yyyy-mm-dd. Optional.

recurrenceInstance 

  • Type: string
  • Required: No
  • Description: Valid values: First, Second, Third, Fourth, Last. Only used for recurrenceType RecursMonthlyNth and RecursYearlyNth. For example, if the recurenceInstance value is First, the holiday recurs on the first Monday of the month every 3 months.

recurrenceInterval 

  • Type: string
  • Required: No
  • Description: The interval of weeks, months, or years the holiday recurs.

recurrenceMonthOfYear 

  • Type: string
  • Required: No
  • Description: Valid values: January, February, March, April, May, June, July, August, September, October, November, December.

recurrenceStartDate 

  • Type: string
  • Required: No
  • Description: The date the holiday starts recurring. Uses the format yyyy-mm-dd.

recurrenceType 

  • Type: string
  • Required: No
  • Description: The recurrence type of the holiday. Valid values are: RecursDaily, RecursEveryWeekday, RecursMonthly, RecursMonthlyNth, RecursWeekly, RecursYearly, RecursYealyNth.

startTime 

  • Type: string
  • Required: No
  • Description: The start time on the date of the holiday. Uses the format HH:mm:ss.SSSZ. startTime and endTime must be both null or both not null. If they are both null, indicates the whole day.

Declarative Metadata Sample Definition 

The following is an example businesshours.settings metadata file:

1<?xml version="1.0" encoding="UTF-8"?>
2<BusinessHoursSettings xmlns="http://soap.sforce.com/2006/04/metadata">
3    <businessHours>
4        <active>true</active>
5        <default>true</default>
6        <fridayEndTime>00:00:00.000Z</fridayEndTime>
7        <fridayStartTime>00:00:00.000Z</fridayStartTime>
8        <mondayEndTime>00:00:00.000Z</mondayEndTime>
9        <mondayStartTime>00:00:00.000Z</mondayStartTime>
10        <name>Default</name>
11        <saturdayEndTime>00:00:00.000Z</saturdayEndTime>
12        <saturdayStartTime>00:00:00.000Z</saturdayStartTime>
13        <sundayEndTime>00:00:00.000Z</sundayEndTime>
14        <sundayStartTime>00:00:00.000Z</sundayStartTime>
15        <thursdayEndTime>00:00:00.000Z</thursdayEndTime>
16        <thursdayStartTime>00:00:00.000Z</thursdayStartTime>
17        <timeZoneId>America/Los_Angeles</timeZoneId>
18        <tuesdayEndTime>00:00:00.000Z</tuesdayEndTime>
19        <tuesdayStartTime>00:00:00.000Z</tuesdayStartTime>
20        <wednesdayEndTime>00:00:00.000Z</wednesdayEndTime>
21        <wednesdayStartTime>00:00:00.000Z</wednesdayStartTime>
22    </businessHours>
23    <businessHours>
24        <active>true</active>
25        <default>false</default>
26        <fridayEndTime>00:00:00.000Z</fridayEndTime>
27        <fridayStartTime>00:00:00.000Z</fridayStartTime>
28        <mondayEndTime>15:00:00.000Z</mondayEndTime>
29        <mondayStartTime>09:00:00.000Z</mondayStartTime>
30        <name>bh1</name>
31        <saturdayEndTime>00:00:00.000Z</saturdayEndTime>
32        <saturdayStartTime>00:00:00.000Z</saturdayStartTime>
33        <sundayEndTime>00:00:00.000Z</sundayEndTime>
34        <sundayStartTime>00:00:00.000Z</sundayStartTime>
35        <thursdayEndTime>17:00:00.000Z</thursdayEndTime>
36        <thursdayStartTime>10:50:00.000Z</thursdayStartTime>
37        <timeZoneId>America/Los_Angeles</timeZoneId>
38        <tuesdayEndTime>13:00:00.000Z</tuesdayEndTime>
39        <tuesdayStartTime>09:00:00.000Z</tuesdayStartTime>
40        <wednesdayEndTime>15:00:00.000Z</wednesdayEndTime>
41        <wednesdayStartTime>09:00:00.000Z</wednesdayStartTime>
42    </businessHours>
43    <holidays>
44        <activityDate>2013-09-02</activityDate>
45        <businessHours>Default</businessHours>
46        <businessHours>bh1</businessHours>
47        <isRecurring>false</isRecurring>
48        <name>Labor Day</name>
49    </holidays>
50    <holidays>
51        <businessHours>bh1</businessHours>
52        <isRecurring>true</isRecurring>
53        <name>Christmas</name>
54        <recurrenceDayOfMonth>25</recurrenceDayOfMonth>
55        <recurrenceMonthOfYear>December</recurrenceMonthOfYear>
56        <recurrenceStartDate>2013-12-25</recurrenceStartDate>
57        <recurrenceType>RecursYearly</recurrenceType>
58    </holidays>
59</BusinessHoursSettings>

The following is an example package.xml manifest that references the BusinessHoursSettings definitions:

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>BusinessHours</members>
5        <name>Settings</name>
6    </types>
7    <version>29.0</version>
8</Package>

Wildcard Support in the Manifest File 

The wildcard character * (asterisk) in the package.xml manifest file doesn’t apply to metadata types for feature settings. The wildcard applies only when retrieving all settings, not for an individual setting. For details, see Settings. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.